|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.model.resource.AntennaSelection
public class AntennaSelection
A selection of antennas.
A selection of antennas can be more than just a collection of antennas. It can be used to make requests such as: "give me at least 5 antennas, preferrably those that result in the longest possible baselines".
Version Info:
$Revision: 1710 $ |
$Date: 2008-11-14 11:54:07 -0700 (Fri, 14 Nov 2008) $ |
$Author: dharland $ |
Constructor Summary | |
---|---|
AntennaSelection()
Creates a new instance using a default AntennaProvider that returns an empty set of Antennas. |
|
AntennaSelection(AntennaProvider antennaProvider)
Creates a new instance using antennaProvider as the source of available antennas to select from. |
Method Summary | |
---|---|
void |
addUserPick(String antennaId)
Adds the given antenna ID to this selection. |
AntennaSelection |
clone()
Returns a selection that is a copy of this one. |
boolean |
equals(Object o)
Returns true if o is equal to this antenna selection. |
AntennaProvider |
getAntennaProvider()
|
AntennaSpecifier |
getIdType()
Returns the type of identifiers returned by getMatchingAntennas() . |
Set<String> |
getMatchingAntennas()
Returns a collection of antenna identifiers represented by this selection. |
AntennaSelectionMethod |
getMethod()
Returns the manner in which antennas will be selected. |
int |
getMinimumNumber()
Returns the minimum number of antennas to select. |
ReceiverBand |
getRequiredReceiver()
Returns the receiver band that must be supported on all returned Antennas. |
int |
hashCode()
Returns a hash code value for this antenna selection. |
void |
recalculateMatchingAntennas()
Selects antennas based on the other properties of this object. |
void |
removeUserPick(String antennaId)
Removes the given antenna ID from this selection. |
void |
reset()
Puts this selection back in its initial state. |
void |
setAntennaProvider(AntennaProvider p)
Sets the AntennaProvider instance used to find the complete set of available Antennas. |
void |
setIdType(AntennaSpecifier newType)
Set the type of identifiers returned by getMatchingAntennas() . |
void |
setMethod(AntennaSelectionMethod newMethod)
Sets the manner in which antennas will be selected. |
void |
setMinimumNumber(int newMin,
AntennaSelectionMethod selectionMethod)
Sets the minimum number of antennas to select and the selection method to use. |
void |
setRequiredReceiver(ReceiverBand b)
Sets a receiver band that must be supported on all returned Antennas. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AntennaSelection(AntennaProvider antennaProvider)
public AntennaSelection()
Method Detail |
---|
public void reset()
public void setMethod(AntennaSelectionMethod newMethod)
Depending on the value of newMethod
, previously set properties
may be cleared.
newMethod
- the manner in which antennas will be selected.
If this value is null, the default method
(see getMethod()
) will be used.public AntennaSelectionMethod getMethod()
AntennaSelectionMethod.ALL
.
public void setIdType(AntennaSpecifier newType)
getMatchingAntennas()
.
newType
- the type of identifiers returned by getMatchingAntennas()
.
If this value is null, the default type
(see getIdType()
) will be used.public AntennaSpecifier getIdType()
getMatchingAntennas()
.
The default value for this property is
AntennaSpecifier.ANTENNA_ID
.
Caveat: If this selection holds a collection of user-specified antennas, there is no guarantee that the user-specified IDs are of the type returned here.
getMatchingAntennas()
.public void setMinimumNumber(int newMin, AntennaSelectionMethod selectionMethod)
newMin
- the minimum number of antennas to select.selectionMethod
- the manner in which antennas will be selected.
IllegalArgumentException
- if newMin
is less than one or if
selectionMethod
does not require specification of a
minimum number of antennas.public int getMinimumNumber()
public void addUserPick(String antennaId)
AntennaSelectionMethod.LIST
.
antennaId
- the ID of a manually selected antenna.public void removeUserPick(String antennaId)
AntennaSelectionMethod.LIST
, this method does nothing.
antennaId
- the ID of antenna to remove from the set of
manually selected antennas.public void setAntennaProvider(AntennaProvider p)
p
is null, then the provider is set to an
instance of DefaultAntennaProvider. In either case the selection returned
by getMatchingAntennas() is recalculated.
public AntennaProvider getAntennaProvider()
public void setRequiredReceiver(ReceiverBand b)
public ReceiverBand getRequiredReceiver()
public Set<String> getMatchingAntennas()
The returned set is not held internally by this selection, so any changes made to it will not be reflected in this object. The returned set is guaranteed to be non-null, but it may be empty.
recalculateMatchingAntennas()
public void recalculateMatchingAntennas()
TODO: What do we do if the AntennaProvider can not meet the requirements laid out in this object?
public AntennaSelection clone()
If anything goes wrong during the cloning procedure,
a RuntimeException
will be thrown.
clone
in class Object
public boolean equals(Object o)
o
is equal to this antenna selection.
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |