|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Number | +--elge.engine.ComboInteger
This class is a simple integer with a list of values, from
which it can be preselected. It is used together with the
ComboIntegerEditor
which enables the user in gui select
it value only from the predefined values.
Constructor Summary | |
ComboInteger(Integer i,
String[] list)
like ComboInteger but also defines the initial value.
|
|
ComboInteger(String[] list)
Constructs a new ComboInteger instance with predefined values from an array string where to each string is defined its index as its value starting at 0. |
Method Summary | |
void |
add(String name)
Adds a name -> list size + 1. |
void |
add(String name,
Integer value)
Adds a name -> value pair to the set. |
double |
doubleValue()
Returns the value of the specified number as a double .
|
float |
floatValue()
Returns the value of the specified number as a float .
|
Hashtable |
getList()
Returns the paris as hastable of name -> value. |
String[] |
getTags()
This is for the propertyEditor support. |
Integer |
getValue()
Returns the actual value. |
Integer |
getValueForName(String name)
Gets the value for a predefined name |
int |
intValue()
Returns the value of the specified number as an int .
|
long |
longValue()
Returns the value of the specified number as a long .
|
void |
setList(Hashtable list)
Sets the list from a hashtable |
void |
setValue(Integer i)
Sets the value. |
void |
setValueForName(String name)
Sets acutal value to the value of the name if it is predefined in this instance. |
String |
toString()
returns the actual value name |
Methods inherited from class java.lang.Number |
byteValue, shortValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ComboInteger(String[] list)
list
- list of value names.public ComboInteger(Integer i, String[] list)
ComboInteger
but also defines the initial value.
The value is not tested and can be beoynd the defined values.
i
- the initial valuelist
- the predefined value names.Method Detail |
public void add(String name, Integer value)
name
- value namevalue
- valuepublic void add(String name)
name
- value namepublic void setList(Hashtable list)
list
- the hashtable of name -> value pairspublic Hashtable getList()
public String[] getTags()
public Integer getValue()
public void setValue(Integer i)
i
- to what to set the value.public Integer getValueForName(String name)
name
- the name to get the value for
public void setValueForName(String name)
name
if it is predefined in this instance.
name
- name of predefined pairs to set the value for.public double doubleValue()
double
.
This may involve rounding.
doubleValue
in class Number
double
.public float floatValue()
float
.
This may involve rounding.
floatValue
in class Number
float
.public int intValue()
int
.
This may involve rounding or truncation.
intValue
in class Number
int
.public long longValue()
long
.
This may involve rounding or truncation.
longValue
in class Number
long
.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |