|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.util.SimpleHashSet<E>
E - Class being stored in SimpleHashSet.public class SimpleHashSet<E>
This class provides very simple HashSet functionality. Designed specially for maintaining pending constraints for evaluation. It's implementation was partially based on standard hash set implementation as implemented in java util class.
| Constructor Summary | |
|---|---|
SimpleHashSet()
Constructs an empty HashSet with the default initial capacity (16) and the default load factor (0.75). |
|
SimpleHashSet(int initialCapacity)
Constructs an empty HashSet with the specified initial capacity and the default load factor (0.75). |
|
SimpleHashSet(int initialCapacity,
float loadFactor)
Constructs an empty HashSet with the specified initial capacity and load factor. |
|
| Method Summary | |
|---|---|
boolean |
add(E element)
Adds the specified element to this set. |
void |
clear()
Removes all elements from this set. |
java.lang.Object |
clone()
Clones this set. |
boolean |
contains(E element)
Returns the boolean value which specifies if given element is already in this identity hash set. |
boolean |
isEmpty()
Returns true if this set contains no elements. |
E |
removeFirst()
Removes and returns an entry removed from the HashSet. |
int |
size()
Returns the number of elements in this set. |
java.lang.String |
toString()
Returns string representation of the hash set. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleHashSet()
public SimpleHashSet(int initialCapacity)
initialCapacity - the initial capacity.
java.lang.IllegalArgumentException - if the initial capacity is negative.
public SimpleHashSet(int initialCapacity,
float loadFactor)
initialCapacity - The initial capacity.loadFactor - The load factor.
java.lang.IllegalArgumentException - if the initial capacity is negative or the load factor is
nonpositive.| Method Detail |
|---|
public boolean add(E element)
element - element with which the specified value is to be associated.
public void clear()
public java.lang.Object clone()
clone in class java.lang.Objectpublic boolean contains(E element)
element - the element whose existence in the hash set is to be checked.
public boolean isEmpty()
public E removeFirst()
public int size()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||