Hilbert II - Version 0.03.01

org.qedeq.kernel.dto.list
Class ElementSet

java.lang.Object
  extended byorg.qedeq.kernel.dto.list.ElementSet

public final class ElementSet
extends Object

This class represents a set of Elements.

Version:
$Revision: 1.3 $

Constructor Summary
ElementSet()
          Constructs an empty element set.
ElementSet(Element[] elements)
          Constructs an element set.
ElementSet(ElementList element)
          Constructs an element set from all operands of an element.
ElementSet(ElementSet set)
          Constructs an element set.
 
Method Summary
 ElementSet add(Element element)
          Add an element to set.
 boolean contains(Element element)
          Is element in set?
 boolean equals(Object obj)
           
 int hashCode()
           
 ElementSet intersection(ElementSet set)
          Build the intersection.
 boolean isEmpty()
          Is set empty?
 boolean isSubset(ElementSet set)
          Is set a subset of this set?
 ElementSet minus(ElementSet set)
          Remove elements from another ElementSet from this set.
 ElementSet newDelta(ElementSet set)
          Return all elements that are only in one of both sets.
 ElementSet newIntersection(ElementSet set)
          Build a new intersection.
 ElementSet remove(Element element)
          Remove an element from set.
 String toString()
           
 ElementSet union(ElementSet set)
          Add elements from another ElementSet to this set.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ElementSet

public ElementSet()
Constructs an empty element set.


ElementSet

public ElementSet(Element[] elements)
Constructs an element set.

Parameters:
elements - the elements to put into the set
Throws:
IllegalArgumentException - if elements was a NullPointer

ElementSet

public ElementSet(ElementSet set)
Constructs an element set.

Parameters:
set - contains the elements to put into the set
Throws:
IllegalArgumentException - if set was a NullPointer

ElementSet

public ElementSet(ElementList element)
Constructs an element set from all operands of an element. The element must not be a symbol.

Parameters:
element - contains the elements to put into the set (without the operator)
Throws:
IllegalArgumentException - if element was a NullPointer or was an atom.
Method Detail

contains

public final boolean contains(Element element)
Is element in set?

Parameters:
element - element to check for.
Returns:
is element in this set?
Throws:
IllegalArgumentException - if the element was a NullPointer

isEmpty

public final boolean isEmpty()
Is set empty?

Returns:
is set empty?

isSubset

public final boolean isSubset(ElementSet set)
Is set a subset of this set?

Parameters:
set - set to check for.
Returns:
is set a subset of this set?
Throws:
IllegalArgumentException - if the set was a NullPointer

add

public final ElementSet add(Element element)
Add an element to set. This object is after the method the union of this set with {element}

Parameters:
element - element to put into the set
Returns:
was this set changed?
Throws:
IllegalArgumentException - if the element was a NullPointer

union

public final ElementSet union(ElementSet set)
Add elements from another ElementSet to this set. After this method this object is the union of the two sets.

Parameters:
set - add all elements that are here
Returns:
was this set changed?
Throws:
IllegalArgumentException - if the set was a NullPointer

remove

public final ElementSet remove(Element element)
Remove an element from set.

Parameters:
element - Element to remove from the set
Returns:
was this set changed?
Throws:
IllegalArgumentException - if the element was a NullPointer

minus

public final ElementSet minus(ElementSet set)
Remove elements from another ElementSet from this set. After this method this object is the asymmetric set difference of the two sets: this \ set.

Parameters:
set - remove all elements that are in this set from this
Returns:
was this set changed?
Throws:
IllegalArgumentException - if the set was a NullPointer

intersection

public final ElementSet intersection(ElementSet set)
Build the intersection.

Parameters:
set - check for these elements
Returns:
was this set changed?
Throws:
IllegalArgumentException - if the set was a NullPointer

newIntersection

public final ElementSet newIntersection(ElementSet set)
Build a new intersection.

Parameters:
set - check for these elements
Returns:
was this set changed?
Throws:
IllegalArgumentException - if the set was a NullPointer

newDelta

public final ElementSet newDelta(ElementSet set)
Return all elements that are only in one of both sets. This method returns the symmetric set difference of the two sets.

Parameters:
set - remove all elements that are in this set from this
Returns:
was this set changed?
Throws:
IllegalArgumentException - if the set was a NullPointer

equals

public final boolean equals(Object obj)

hashCode

public final int hashCode()

toString

public final String toString()

Hilbert II - Version 0.03.01

©left GNU General Public Licence
All Rights Reserved.