|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.data.LyValue
leon.data.LyFieldInfoValue
leon.data.LyChoiceValue
public final class LyChoiceValue
This class offers methods for constructing, accessing and modifying values corresponding to a LyChoiceFieldInfo.
LyChoiceFieldInfo
,
LyObject
Field Summary | |
---|---|
static java.lang.String |
__VERSION
File version. |
Constructor Summary | |
---|---|
LyChoiceValue(LyChoiceFieldInfo choiceFieldInfo)
Constructs an empty choice value for the given choice field. |
|
LyChoiceValue(LyChoiceFieldInfo choiceFieldInfo,
java.util.BitSet value)
Constructs a choice value for the given choice field from a BitSet. |
|
LyChoiceValue(LyChoiceFieldInfo choiceFieldInfo,
int value)
Constructs a choice value for the given choice field from an int. |
|
LyChoiceValue(LyChoiceFieldInfo choiceFieldInfo,
short value)
Constructs a choice value for the given choice field from a short. |
|
LyChoiceValue(LyChoiceFieldInfo choiceFieldInfo,
java.lang.Short value)
Constructs a choice value for the given choice field from a Short object. |
|
LyChoiceValue(LyChoiceFieldInfo choiceFieldInfo,
java.lang.String value)
Constructs a choice value for the given choice field from a string. |
Method Summary | |
---|---|
void |
checkIndex(int index)
Method for checking if index passed to methods is valid or not. |
void |
clearOption(short index)
Clears an option in this choice value. |
java.util.BitSet |
getBitSetValue()
Gets value of this choice value as a BitSet. |
java.lang.String |
getName(int index)
Gets the name of the specified selected option in this choice value. |
java.lang.Object |
getOptionValue(int index)
Gets the value of the specified selected option in this choice value. |
java.lang.Short |
getShortValue()
Gets value of this choice value as a Short. |
java.lang.String |
getString(int index)
Gets the id of the specified selected option in this choice value. |
java.lang.String |
getValue(int level)
Return the value for a given level. |
java.lang.String |
getValue(int level,
int index)
Return the value for a specific index at the given level. |
short |
getValueCount()
Gets number of selected options in this choice value. |
boolean |
isSelected(java.lang.Object value)
Checks an option with the given value, id or name is selected in this choice value. |
boolean |
isSelected(short index)
Checks if the option at the given index is selected or not in this choice value. |
void |
setOption(short index)
Sets an option in this choice value. |
short |
shortValue()
Gets value of this choice value as a short. |
Methods inherited from class leon.data.LyFieldInfoValue |
---|
compare, contains, equals, equals, getFieldInfo, getName, getName, getShortName, getString |
Methods inherited from class leon.data.LyValue |
---|
getField, getValue, isNull, setValue, toString |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
Constructor Detail |
---|
public LyChoiceValue(LyChoiceFieldInfo choiceFieldInfo)
choiceFieldInfo
- Choice fieldInfo for which a value is created.public LyChoiceValue(LyChoiceFieldInfo choiceFieldInfo, java.lang.String value)
choiceFieldInfo
- Choice fieldInfo for which a value is created.value
- String value. If the choice field is multiple, several options may
be selected from the same string, in that case, the different
sub-strings corresponding to each option must be separated by
LyApplication.VALUE_SEP. For one option, the given string can be (in
this order) : the internal value of the option, its id or its the
name (untranslated).LyChoiceFieldInfo.parse(java.lang.String)
public LyChoiceValue(LyChoiceFieldInfo choiceFieldInfo, short value)
choiceFieldInfo
- Choice fieldInfo for which a value is created.value
- Value passed as a short. This short value represents the
position of the chosen option in options list (0 is the firs
one).
java.lang.IllegalArgumentException
- If the value is negative.
java.lang.IllegalArgumentException
- If the value is greater or equal to number of options
in the given choice.public LyChoiceValue(LyChoiceFieldInfo choiceFieldInfo, int value)
choiceFieldInfo
- Choice fieldInfo for which a value is created.value
- Value passed as an int. This integer value represents the
position of the chosen option in options list (0 is the firs
one).
java.lang.IllegalArgumentException
- If the value is negative.
java.lang.IllegalArgumentException
- If the value is greater or equal to number of options
in the given choice.public LyChoiceValue(LyChoiceFieldInfo choiceFieldInfo, java.lang.Short value)
choiceFieldInfo
- Choice fieldInfo for which a value is created.value
- Value passed as a Short. This Short value represents the
position of the chosen option in options list (0 is the firs
one).
java.lang.IllegalArgumentException
- If the value is negative.
java.lang.IllegalArgumentException
- If the value is greater or equal to number of options
in the given choice.public LyChoiceValue(LyChoiceFieldInfo choiceFieldInfo, java.util.BitSet value)
choiceFieldInfo
- Choice fieldInfo for which a value is created.value
- Value passed as a BitSet.
java.lang.IllegalStateException
- If the choice field is not multiple.Method Detail |
---|
public void checkIndex(int index)
index
- index to check
java.lang.IllegalArgumentException
- If the given index is negative.
java.lang.IllegalArgumentException
- If the given index is greater or equal to the number of
options of the choice field.public short shortValue()
public java.lang.Short getShortValue()
java.lang.IllegalStateException
- If the choice field is multiple.public java.util.BitSet getBitSetValue()
java.lang.IllegalStateException
- If the choice field is not multiple.public short getValueCount()
public java.lang.String getString(int index)
index
- Index of requested option id.
java.lang.IllegalArgumentException
- If index is negative.
java.lang.IllegalArgumentException
- If index is greater than the number of options selected
in this value.public java.lang.String getName(int index)
index
- Index of requested option name.
java.lang.IllegalArgumentException
- If index is negative.
java.lang.IllegalArgumentException
- If index is greater than the number of options selected
in this value.public java.lang.String getValue(int level)
level
- the requested level
public java.lang.String getValue(int level, int index)
level
- the requested levelindex
- the index of the requested option id
public boolean isSelected(short index)
index
- Index of the tested option. The given index is checked by method checkIndex,
this method may throw exceptions.
checkIndex(int)
public boolean isSelected(java.lang.Object value)
value
- Value, id or name of the tested option.
java.lang.IllegalArgumentException
- if no option corresponds to the given value, id or
name.checkIndex(int)
public void setOption(short index)
index
- Index of the set option. The given index is checked by method checkIndex, this
method may throw exceptions.checkIndex(int)
public void clearOption(short index)
index
- Index of the cleared option. The given index is checked by method checkIndex,
this method may throw exceptions.checkIndex(int)
public java.lang.Object getOptionValue(int index)
index
- Index of requested option id.
java.lang.IllegalArgumentException
- If index is negative.
java.lang.IllegalArgumentException
- If index is greater than the number of options selected
in this value.
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |