org.qedeq.kernel.bo.common
Class QedeqBoSet

java.lang.Object
  extended by org.qedeq.kernel.bo.common.QedeqBoSet

public class QedeqBoSet
extends java.lang.Object

This class represents a set of QedeqBos.

Author:
Michael Meyling

Constructor Summary
QedeqBoSet()
          Constructs an empty element set.
QedeqBoSet(QedeqBo element)
          Constructs an element set.
QedeqBoSet(QedeqBo[] elements)
          Constructs an element set.
QedeqBoSet(QedeqBoSet set)
          Constructs an element set.
 
Method Summary
 QedeqBoSet add(QedeqBo element)
          Add an element to set.
 QedeqBoSet add(QedeqBoSet set)
          Add elements from another QedeqBoSet to this set.
 java.lang.String asLongList()
           
 java.lang.String asShortList()
           
 boolean contains(QedeqBo element)
          Is element in set?
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 QedeqBoSet intersection(QedeqBoSet set)
          Build the intersection.
 boolean isEmpty()
          Is this set empty?
 java.util.Iterator iterator()
          Returns an iterator over the elements in this set.
 QedeqBoSet remove(QedeqBo element)
          Remove an element from this set.
 QedeqBoSet remove(QedeqBoSet set)
          Remove elements from another QedeqBoSet from this set.
 int size()
          Get number of elements.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QedeqBoSet

public QedeqBoSet()
Constructs an empty element set.


QedeqBoSet

public QedeqBoSet(QedeqBo[] elements)
Constructs an element set.

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

QedeqBoSet

public QedeqBoSet(QedeqBo element)
Constructs an element set.

Parameters:
element - Put this element into the set
Throws:
java.lang.IllegalArgumentException - if element was a NullPointer

QedeqBoSet

public QedeqBoSet(QedeqBoSet set)
Constructs an element set.

Parameters:
set - contains the elements to put into the set
Throws:
java.lang.IllegalArgumentException - if set was a NullPointer
Method Detail

contains

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

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

isEmpty

public final boolean isEmpty()
Is this set empty?

Returns:
Is this set empty?

add

public final QedeqBoSet add(QedeqBo 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:
Possibly changed this.
Throws:
java.lang.IllegalArgumentException - if the element was a NullPointer

add

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

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

remove

public final QedeqBoSet remove(QedeqBo element)
Remove an element from this set.

Parameters:
element - QedeqBo to remove from the set. Must not be null.
Returns:
Possibly changed this.
Throws:
java.lang.IllegalArgumentException - if the element was a NullPointer

remove

public final QedeqBoSet remove(QedeqBoSet set)
Remove elements from another QedeqBoSet 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:
Possibly changed this.
Throws:
java.lang.IllegalArgumentException - if the set was a NullPointer

intersection

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

Parameters:
set - Check for these elements.
Returns:
Possibly changed this.
Throws:
java.lang.IllegalArgumentException - if the set was a NullPointer

size

public final int size()
Get number of elements.

Returns:
Number of elements in this set.

iterator

public java.util.Iterator iterator()
Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Returns:
Iterator over the elements in this set.

equals

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

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

asLongList

public java.lang.String asLongList()

asShortList

public java.lang.String asShortList()


Copyright © 2014. All Rights Reserved.