net.sourceforge.gxl
Class GXLSet

java.lang.Object
  |
  +--net.sourceforge.gxl.GXLElement
        |
        +--net.sourceforge.gxl.GXLValue
              |
              +--net.sourceforge.gxl.GXLCompositeValue
                    |
                    +--net.sourceforge.gxl.GXLSet

public class GXLSet
extends GXLCompositeValue

Represents the GXL set element.

The set element is a composite value element to describe a set, unordered and without duplicates. That being said, it is up to the application to ensure that no duplicates exist and treat the values unorderly.

Note that the set element requires all it's value elements to be of the same value type (that is, it must be a set of ints or a set of strings etc).

Children
GXLValue - a set can contain zero or more values

Attributes
The set element may not contain any attributes.

See Also:
GXLValue

Constructor Summary
GXLSet()
          Creates a new (empty) GXLSet element.
 
Method Summary
 boolean contains(GXLValue element)
          Returns whether this set contains the specified element.
 boolean equals(Object o)
          Compares this set to another object.
 
Methods inherited from class net.sourceforge.gxl.GXLCompositeValue
getValueAt, getValueCount
 
Methods inherited from class net.sourceforge.gxl.GXLElement
add, getAttribute, getChildAt, getChildCount, getDocument, getParent, indexOf, insert, remove, setAttribute
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GXLSet

public GXLSet()
Creates a new (empty) GXLSet element.

Method Detail

contains

public boolean contains(GXLValue element)
Returns whether this set contains the specified element. Comparation is done with the equals method. To find out which elements are contained in this set, use the getChildAt(int i) method.

Parameters:
element - The element to search for.
Returns:
Whether this set contains the specified element.
See Also:
GXLElement.getChildAt(int)

equals

public boolean equals(Object o)
Compares this set to another object. Equality is defined as containing the same elements regardless of order.

Overrides:
equals in class Object
Parameters:
o - The other object to compare this to.
Returns:
Whether this set is considered equal to the compared object.
Throws:
ClassCastException - If the compared object is not an instance of GXLSet.
See Also:
contains(GXLValue)