org.qtitools.qti.value
Class MultipleValue

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

public class MultipleValue
extends ListValue

Implementation of "bag-type" container.

This container can be multiple 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
MultipleValue()
          Constructs empty (NULL) MultipleValue container.
MultipleValue(MultipleValue value)
          Constructs empty (NULL) MultipleValue container and adds given MultipleValue into it.
MultipleValue(SingleValue value)
          Constructs empty (NULL) MultipleValue container and adds given SingleValue into it.
MultipleValue(SingleValue[] values)
          Constructs empty (NULL) MultipleValue container and adds all given SingleValues into it.
 
Method Summary
 boolean add(MultipleValue value)
          Adds MultipleValue into this container.
 boolean contains(MultipleValue multipleValue)
          Returns true if this container contains given MultipleValue; 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

MultipleValue

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


MultipleValue

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

Parameters:
value - added SingleValue

MultipleValue

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

Parameters:
values - added SingleValues

MultipleValue

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

Parameters:
value - added MultipleValue
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(MultipleValue multipleValue)
Returns true if this container contains given MultipleValue; false otherwise.

Parameters:
multipleValue - given MultipleValue
Returns:
true if this container contains given MultipleValue; false otherwise

add

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

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

Multiple container can contain only values of the same BaseType.

NULL MultipleValue container is ignored.

Parameters:
value - added MultipleValue
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.