public class CompoundProperty extends AbstractProperty<ArrayList<AbstractProperty<?>>>
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 30 dec. 2014
Constructor and Description |
---|
CompoundProperty(String shortName,
String description,
ArrayList<AbstractProperty<?>> initialValue,
boolean readOnly,
int displayPriority)
Construct a CompoundProperty.
|
Modifier and Type | Method and Description |
---|---|
void |
add(AbstractProperty<?> ap)
Add an AbstractProperty at the end of the list.
|
void |
add(int index,
AbstractProperty<?> ap)
Add an AbstractProperty at a specified position.
|
AbstractProperty<ArrayList<AbstractProperty<?>>> |
deepCopy()
Construct a deep copy of this property (duplicates everything except immutable fields).
|
ArrayList<AbstractProperty<?>> |
displayOrderedValue()
Return the sub-items in display order.
|
AbstractProperty<?> |
findByShortName(String name)
Find an embedded AbstractProperty that has a specified shortName.
|
AbstractProperty<?> |
get(int index)
Return the sub property at a specified index.
|
String |
getDescription()
Return a description of the property (may use HTML markup).
|
String |
getShortName()
Return a short description of the property.
|
ArrayList<AbstractProperty<?>> |
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 |
remove(AbstractProperty<?> removeMe)
Remove a property from this CompoundProperty.
|
void |
remove(int index)
Remove a sub property from this CompoundProperty.
|
void |
setValue(ArrayList<AbstractProperty<?>> newValue)
Change the value of the property.
|
int |
size()
Return the number of sub properties of this CompoundProperty.
|
getDisplayPriority, iterator, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public CompoundProperty(String shortName, String description, ArrayList<AbstractProperty<?>> initialValue, boolean readOnly, int displayPriority)
shortName
- String; the short name of the new CompoundPropertydescription
- String; description of the new CompoundProperty (may use HTML mark up)initialValue
- Integer; the initial value of the new CompoundPropertyreadOnly
- boolean; if true this CompoundProperty can not be altereddisplayPriority
- int; the display priority of the new CompoundPropertypublic final ArrayList<AbstractProperty<?>> getValue()
getValue
in class AbstractProperty<ArrayList<AbstractProperty<?>>>
public final String getShortName()
getShortName
in class AbstractProperty<ArrayList<AbstractProperty<?>>>
public final String getDescription()
getDescription
in class AbstractProperty<ArrayList<AbstractProperty<?>>>
public final void setValue(ArrayList<AbstractProperty<?>> newValue) throws PropertyException
setValue
in class AbstractProperty<ArrayList<AbstractProperty<?>>>
newValue
- T; the new value for the propertyPropertyException
- when this Property is read-only, or newValue is not validpublic final boolean isReadOnly()
isReadOnly
in class AbstractProperty<ArrayList<AbstractProperty<?>>>
public final AbstractProperty<?> findByShortName(String name)
name
- String; the name of the sought embedded AbstractPropertypublic final void add(int index, AbstractProperty<?> ap) throws PropertyException
index
- int; the position where the AbstractProperty must be addedap
- AbstractProperty; the property to addPropertyException
- when this CompoundProperty is read-only, or index is out of rangepublic final void add(AbstractProperty<?> ap) throws PropertyException
ap
- AbstractProperty; the property to addPropertyException
- when this CompoundProperty is read-onlypublic final void remove(int index) throws PropertyException
index
- int; the position of the sub property to removePropertyException
- when this CompoundProperty is read-only, or index is out of rangepublic final int size()
public final AbstractProperty<?> get(int index) throws PropertyException
index
- int; the index of the property to retrievePropertyException
- when index is out of rangepublic final ArrayList<AbstractProperty<?>> displayOrderedValue()
public final String htmlStateDescription()
htmlStateDescription
in class AbstractProperty<ArrayList<AbstractProperty<?>>>
public final void remove(AbstractProperty<?> removeMe) throws PropertyException
removeMe
- AbstractProperty the property that must be removedPropertyException
- when the supplied property cannot be removed (probably because it is not part of this
CompoundProperty)public AbstractProperty<ArrayList<AbstractProperty<?>>> deepCopy()
deepCopy
in class AbstractProperty<ArrayList<AbstractProperty<?>>>
Copyright © 2014–2015 Delft University of Technology. All rights reserved.