|
FreeHEP API Version v1.2.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.freehep.util.parameterdatabase.selector.Selector
This provides a class which allows the user to choose between a small number of different choices. Instances of this class and subclasses should be immutable. This is intended to work within a table context. For everything to work correctly, the subclasses must provide a constructor which takes an Object as an argument and one which takes a String as an argument. The String constructor must work with the Strings produced from the getTag() method. For some of the utility routines to work, the iterator over all of the possible selector values must be provided. The initialization of the underlying data structure and the filling with possible values should be done in a static context.
Constructor Summary | |
|
Selector(Object value)
This constructor will create a Selector with the given value. |
|
Selector(String tag)
This constructor will create a Selector from the given tag. |
protected |
Selector(String tag,
Object value)
This protected constructor unconditionally creates a Selector with the given value. |
Method Summary | |
boolean |
equals(Object obj)
For equality, the two objects must have the same class and the same underlying value (compared with equals()). |
boolean |
getBooleanValue()
This returns the value associated with this Selector as a boolean. |
double |
getDoubleValue()
This returns the value associated with this Selector as a double. |
int |
getIntValue()
This returns the value associated with this Selector as an int. |
protected Selector |
getSelectorFromTag(String tag)
Return a Selector object which corresponds to the given tag. |
protected Selector |
getSelectorFromValue(Object value)
Return a Selector object which corresponds to the given value. |
String |
getTag()
This returns the associated tag for this Selector. |
Object |
getValue()
This returns the value associated with this Selector as an Object. |
int |
hashCode()
The hashcode for this object is the one from the underlying value. |
void |
initialize(JComboBox comboBox)
Initialize a JComboBox with all of the possible values. |
abstract Iterator |
iterator()
This returns an iterator over all of the possible Selector objects of this class. |
String |
toString()
Return the tag associated with this selector's value. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected Selector(String tag, Object value)
public Selector(Object value)
public Selector(String tag)
Method Detail |
protected Selector getSelectorFromValue(Object value)
protected Selector getSelectorFromTag(String tag)
public abstract Iterator iterator()
public String getTag()
public Object getValue()
public int getIntValue()
public double getDoubleValue()
public boolean getBooleanValue()
public String toString()
toString
in class Object
public void initialize(JComboBox comboBox)
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
FreeHEP API Version v1.2.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |