|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.model.FreeColObject
net.sf.freecol.common.option.AbstractOption<java.util.List<AbstractOption<T>>>
net.sf.freecol.common.option.ListOption<T>
public class ListOption<T>
Represents a List of Options.
| Field Summary | |
|---|---|
private static java.util.logging.Logger |
logger
|
private int |
maximumNumber
The maximum number of list entries. |
private AbstractOption<T> |
template
The AbstractOption used to generate new values. |
private java.util.List<AbstractOption<T>> |
value
A list of Options. |
| Fields inherited from class net.sf.freecol.common.option.AbstractOption |
|---|
isDefined |
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG |
| Constructor Summary | |
|---|---|
ListOption(Specification specification)
Creates a new ListOption. |
|
ListOption(java.lang.String id)
Creates a new ListOption. |
|
| Method Summary | |
|---|---|
ListOption<T> |
clone()
|
int |
getMaximumValue()
Returns the maximum allowed value. |
java.util.List<T> |
getOptionValues()
|
AbstractOption<T> |
getTemplate()
|
java.util.List<AbstractOption<T>> |
getValue()
Gets the current value of this ListOption. |
static java.lang.String |
getXMLElementTagName()
Gets the tag name of the root element representing this object. |
boolean |
isNullValueOK()
Returns whether null is an acceptable value for
this AbstractOption. |
protected void |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
Initialize this object from an XML-representation of this object. |
void |
setMaximumValue(int maximumNumber)
Sets the maximum allowed value. |
void |
setTemplate(AbstractOption<T> template)
|
void |
setValue(java.util.List<AbstractOption<T>> value)
Sets the value of this ListOption. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
This method writes an XML-representation of this object to the given stream. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out,
java.lang.String tag)
|
| Methods inherited from class net.sf.freecol.common.option.AbstractOption |
|---|
generateChoices, getGroup, readAttributes, readOption, setGroup, setValue, setValues |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.freecol.common.option.Option |
|---|
getId, readFromXML, toString, toXML |
| Field Detail |
|---|
private static java.util.logging.Logger logger
private java.util.List<AbstractOption<T>> value
private AbstractOption<T> template
private int maximumNumber
| Constructor Detail |
|---|
public ListOption(java.lang.String id)
ListOption.
id - The identifier for this option. This is used when the object
should be found in an OptionGroup.public ListOption(Specification specification)
ListOption.
specification - The specification this option belongs
to. May be null.| Method Detail |
|---|
public ListOption<T> clone()
clone in interface Option<java.util.List<AbstractOption<T>>>clone in class AbstractOption<java.util.List<AbstractOption<T>>>public int getMaximumValue()
public void setMaximumValue(int maximumNumber)
maximumNumber - the maximum value to setpublic java.util.List<AbstractOption<T>> getValue()
ListOption.
getValue in interface Option<java.util.List<AbstractOption<T>>>getValue in class AbstractOption<java.util.List<AbstractOption<T>>>public java.util.List<T> getOptionValues()
public void setValue(java.util.List<AbstractOption<T>> value)
ListOption.
setValue in interface Option<java.util.List<AbstractOption<T>>>setValue in class AbstractOption<java.util.List<AbstractOption<T>>>value - The value to be set.public AbstractOption<T> getTemplate()
public void setTemplate(AbstractOption<T> template)
public boolean isNullValueOK()
null is an acceptable value for
this AbstractOption. This method always returns true.
isNullValueOK in class AbstractOption<java.util.List<AbstractOption<T>>>
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
toXMLImpl in class FreeColObjectout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing
to the stream.
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out,
java.lang.String tag)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readFromXMLImpl in class AbstractOption<java.util.List<AbstractOption<T>>>in - The input stream with the XML.
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.public static java.lang.String getXMLElementTagName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||