org.foray.fotree.value
Class ValueCollection

java.lang.Object
  extended by org.foray.fotree.value.PropertyValueStatic
      extended by org.foray.fotree.value.ValueCollection
All Implemented Interfaces:
PropertyValue

public class ValueCollection
extends PropertyValueStatic

A collection of one or more other PropertyValue instances that is itself a PropertyValue.


Constructor Summary
ValueCollection()
          Constructor.
 
Method Summary
 void addItem(PropertyValue pv)
          Adds an item to the collection.
 boolean canEvalKeyword()
          Indicates whether this property value can evaluate to a keyword.
 PvKeyword evalKeyword()
          Returns the keyword value of this property value.
 int getCount()
          Returns the number of items in this collection.
 PropertyValue getItem(int index)
          Returns a specific item from the collection.
 List<PropertyValue> getValue()
          Returns the list of values in this collection.
 String[] toStringArray()
          Returns the collection as an array of Strings.
 
Methods inherited from class org.foray.fotree.value.PropertyValueStatic
canEvalColor, canEvalInteger, canEvalLength, canEvalNumeric, canEvalPercentage, evalColor, evalInteger, evalIntegerException, evalKeywordException, evalLength, evalLengthException, evalNumeric, evalPercentage, evalPercentageException, getUnitPower, lengthRequiresFontSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueCollection

public ValueCollection()
Constructor.

Method Detail

addItem

public void addItem(PropertyValue pv)
Adds an item to the collection.

Parameters:
pv - The item to add to the collection of property values.

getValue

public List<PropertyValue> getValue()
Returns the list of values in this collection.

Returns:
The list of values in this collection.

getCount

public int getCount()
Returns the number of items in this collection.

Returns:
The number of items in this collection.

getItem

public PropertyValue getItem(int index)
Returns a specific item from the collection.

Parameters:
index - The index to the item needed.
Returns:
The item at index.

toStringArray

public String[] toStringArray()
Returns the collection as an array of Strings.

Returns:
The collection as an array of Strings.

canEvalKeyword

public boolean canEvalKeyword()
Description copied from interface: PropertyValue
Indicates whether this property value can evaluate to a keyword.

Returns:
True iff this property value can evaluate to a keyword.

evalKeyword

public PvKeyword evalKeyword()
Description copied from interface: PropertyValue
Returns the keyword value of this property value. This method should only be executed on instances where PropertyValue.canEvalKeyword() returns true. Doing so on other instances may result in an IllegalStateException.

Returns:
The keyword value of this property value.


Copyright © 2017. All rights reserved.