|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--voji.utils.VChoice
This class facilates implementing a choice for the user. There are methods for mapping between names, values and indices.
Field Summary | |
protected java.util.Vector |
data
A Vector of (name,value) pairs containing the data |
protected int |
defIndex
The default index. |
Constructor Summary | |
VChoice()
Creates a new VChoice instance without data |
|
VChoice(java.lang.Object[] data)
Creates a new VChoice instance with initial data |
Method Summary | |
void |
add(java.lang.Object name,
java.lang.Object value)
Adds an entry |
void |
clear()
Removes all entries |
java.lang.Object[] |
elements()
Returns an Array for Lists and ComboBoxes |
java.lang.Object |
i2v(int index)
Returns the value of an index |
void |
setData(java.util.Iterator data)
Sets the data of this instance |
void |
setData(java.sql.ResultSet data)
Sets the data of this instance |
int |
v2i(java.lang.Object value)
Returns the index of a value |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector data
protected int defIndex
null
value.
Constructor Detail |
public VChoice(java.lang.Object[] data)
data
- an array of name-value-name-value-...public VChoice()
Method Detail |
public void clear()
public void add(java.lang.Object name, java.lang.Object value)
name
- key of the entry (for elements())value
- value of the entry (for i2v and v2i)public void setData(java.util.Iterator data)
data
- an Iterator of name-value-name-value-...public void setData(java.sql.ResultSet data) throws java.sql.SQLException
data
- an ResultSet of (name;value)
java.sql.SQLException
- if there is an SQLException
while working with the ResultSetpublic int v2i(java.lang.Object value)
value
- the value that has to be looked for
public java.lang.Object i2v(int index)
index
- the index where to look at
public java.lang.Object[] elements()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |