|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.util.SparseSet
public class SparseSet
Sparse set representation of the set.
| Field Summary | |
|---|---|
int[] |
dense
Dense array used within SparseSet functionality. |
int |
members
It specifies number of elements in the SparseSet. |
int[] |
sparse
Sparse array used within SparseSet functionality. |
| Constructor Summary | |
|---|---|
SparseSet(int size)
It creates a SparseSet with given upper limit on the value of the biggest element in the set. |
|
| Method Summary | |
|---|---|
boolean |
addMember(int value)
It adds an element to the set. |
void |
clear()
It removes all the elements by setting the number of members to zero. |
boolean |
isEmpty()
It returns true if the set is empty. |
boolean |
isMember(int k)
It checks if the specified element belongs to the set. |
void |
setSize(int size)
It sets the size of the SparseSet. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int[] sparse
public int[] dense
public int members
| Constructor Detail |
|---|
public SparseSet(int size)
size - | Method Detail |
|---|
public boolean isMember(int k)
k - element for which the membership in the given set is checked.
public boolean addMember(int value)
value - value being added.
public void setSize(int size)
size - the assigned size of the set.public boolean isEmpty()
public void clear()
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 | ||||||||