public class SelectionProperty extends AbstractProperty<String>
Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-07-26 01:01:13 +0200 (Sun, 26 Jul 2015) $, @version $Revision: 1155 $, by $Author: averbraeck $,
initial version 19 dec. 2014
Constructor and Description |
---|
SelectionProperty(String shortName,
String description,
String[] options,
int initialDefaultOption,
boolean readOnly,
int displayPriority)
Construct a new SelectionProperty.
|
Modifier and Type | Method and Description |
---|---|
AbstractProperty<String> |
deepCopy()
Construct a deep copy of this property (duplicates everything except immutable fields).
|
String |
getDescription()
Return a description of the property (may use HTML markup).
|
String |
getOptionName(int index)
Retrieve the name of one of the options of this SelectionProperty.
|
String[] |
getOptionNames()
Return the names of the options of this SelectionProperty.
|
String |
getShortName()
Return a short description of the property.
|
String |
getValue()
Retrieve the current value of the property.
|
String |
htmlStateDescription()
Generate a description of the state of this property in HTML (excluding the <html> at the start and the
</html> at the end.
|
boolean |
isReadOnly()
Return true if the property can not be altered.
|
void |
setValue(String newValue)
Change the value of the property.
|
getDisplayPriority, iterator, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public SelectionProperty(String shortName, String description, String[] options, int initialDefaultOption, boolean readOnly, int displayPriority)
shortName
- String; name of the new SelectionPropertydescription
- String; description of the new SelectionProperty (may use HTML mark up)options
- String[]; the possible values of the SelectionPropertyinitialDefaultOption
- int; the index of the initially selected optionreadOnly
- boolean; if true the selection cannot be altered.displayPriority
- int; the display priority of the new SelectionPropertypublic final String getValue()
getValue
in class AbstractProperty<String>
public final String getOptionName(int index)
index
- int; the index of the valuepublic final String getShortName()
getShortName
in class AbstractProperty<String>
public final String getDescription()
getDescription
in class AbstractProperty<String>
public final void setValue(String newValue) throws PropertyException
setValue
in class AbstractProperty<String>
newValue
- T; the new value for the propertyPropertyException
- when this Property is read-only, or newValue is not validpublic final String[] getOptionNames()
public final boolean isReadOnly()
isReadOnly
in class AbstractProperty<String>
public final String htmlStateDescription()
htmlStateDescription
in class AbstractProperty<String>
public AbstractProperty<String> deepCopy()
deepCopy
in class AbstractProperty<String>
Copyright © 2014–2015 Delft University of Technology. All rights reserved.