org.qtitools.qti.value
Class OrderedValue

java.lang.Object
  extended by org.qtitools.qti.value.ListValue
      extended by org.qtitools.qti.value.OrderedValue
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<SingleValue>, MultiValue, Value

public class OrderedValue
extends ListValue

Implementation of "sequence-type" container.

This container can be ordered or NULL (if empty).

Author:
Jiri Kajaba
See Also:
Cardinality, Serialized Form

Field Summary
 
Fields inherited from class org.qtitools.qti.value.ListValue
container
 
Constructor Summary
OrderedValue()
          Constructs empty (NULL) OrderedValue container.
OrderedValue(OrderedValue value)
          Constructs empty (NULL) OrderedValue container and adds given OrderedValue into it.
OrderedValue(SingleValue value)
          Constructs empty (NULL) OrderedValue container and adds given SingleValue into it.
OrderedValue(SingleValue[] values)
          Constructs empty (NULL) OrderedValue container and adds all given SingleValues into it.
 
Method Summary
 boolean add(OrderedValue value)
          Adds OrderedValue into this container.
 boolean contains(OrderedValue orderedValue)
          Returns true if this container contains given OrderedValue; false otherwise.
 boolean equals(java.lang.Object object)
           
 Cardinality getCardinality()
          Returns cardinality of this value.
 boolean isOrdered()
          Returns true if this container is ordered; false otherwise.
 
Methods inherited from class org.qtitools.qti.value.ListValue
add, clone, contains, count, get, getAll, getBaseType, hashCode, isNull, iterator, removeAll, size, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OrderedValue

public OrderedValue()
Constructs empty (NULL) OrderedValue container.


OrderedValue

public OrderedValue(SingleValue value)
Constructs empty (NULL) OrderedValue container and adds given SingleValue into it.

Parameters:
value - added SingleValue

OrderedValue

public OrderedValue(SingleValue[] values)
Constructs empty (NULL) OrderedValue container and adds all given SingleValues into it.

Parameters:
values - added SingleValues

OrderedValue

public OrderedValue(OrderedValue value)
Constructs empty (NULL) OrderedValue container and adds given OrderedValue into it.

Parameters:
value - added OrderedValue
Method Detail

getCardinality

public Cardinality getCardinality()
Description copied from interface: Value
Returns cardinality of this value.

If value is NULL returns null.

Returns:
cardinality of this value

isOrdered

public boolean isOrdered()
Description copied from class: ListValue
Returns true if this container is ordered; false otherwise.

Specified by:
isOrdered in class ListValue
Returns:
true if this container is ordered; false otherwise

contains

public boolean contains(OrderedValue orderedValue)
Returns true if this container contains given OrderedValue; false otherwise.

Parameters:
orderedValue - given OrderedValue
Returns:
true if this container contains given OrderedValue; false otherwise

add

public boolean add(OrderedValue value)
            throws QTIBaseTypeException
Adds OrderedValue into this container.

Takes all values from OrderedValue container and adds them into this container.

Ordered container can contain only values of the same BaseType.

NULL OrderedValue container is ignored.

Parameters:
value - added OrderedValue
Returns:
true if value was added; false otherwise
Throws:
QTIBaseTypeException - if BaseType is not same

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object


Copyright © 2009. All Rights Reserved.