|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--Opus5.AbstractObject
|
+--Opus5.AbstractContainer
|
+--Opus5.AbstractSearchableContainer
|
+--Opus5.AbstractSet
|
+--Opus5.SetAsBitVector
Set implemented using a vector of ints.
| Field Summary | |
protected static int |
intBits
The number of bits in an int. |
protected int[] |
vector
The vector. |
| Fields inherited from class Opus5.AbstractSet |
universeSize |
| Fields inherited from class Opus5.AbstractContainer |
count |
| Fields inherited from interface Opus5.Set |
copyright |
| Constructor Summary | |
SetAsBitVector(int n)
Constructs a SetAsBitVector for the specified size
of universal set. |
|
| Method Summary | |
void |
accept(Visitor visitor)
Accepts a visitor and makes it visit the elements of this set. |
protected int |
compareTo(Comparable arg)
Compares this set with the specified comparable object. |
Set |
difference(Set set)
Returns a set which is the difference between this set and the specified set. |
int |
getCount()
Returns the number of elements in this set. |
Enumeration |
getEnumeration()
Returns an enumeration that enumerates the elements of this set. |
protected void |
insert(int item)
Inserts the specified item into this set. |
Set |
intersection(Set set)
Returns a set which is the intersection of this set and the specified set. |
boolean |
isEmpty()
Tests whether this set is empty. |
boolean |
isEQ(Set set)
Tests whether this set is equal to the specified set. |
boolean |
isFull()
Tests whether this set is full. |
protected boolean |
isMember(int item)
Tests if the specified item is a member of this set. |
boolean |
isSubset(Set set)
Tests whether this set is a subset of the specified set. |
void |
purge()
Purges this set, making it empty. |
Set |
union(Set set)
Returns a set which is the union of this set and the specified set. |
protected void |
withdraw(int item)
Withdraws the specified item from this set. |
| Methods inherited from class Opus5.AbstractSet |
find, insert, isMember, withdraw |
| Methods inherited from class Opus5.AbstractContainer |
hashCode, toString |
| Methods inherited from class Opus5.AbstractObject |
compare, equals, isEQ, isGE, isGT, isLE, isLT, isNE |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface Opus5.SearchableContainer |
find, insert, isMember, withdraw |
| Methods inherited from interface Opus5.Comparable |
compare, isEQ, isGE, isGT, isLE, isLT, isNE |
| Field Detail |
protected int[] vector
protected static final int intBits
int.| Constructor Detail |
public SetAsBitVector(int n)
SetAsBitVector for the specified size
of universal set.n - The number of elements in the universal set.| Method Detail |
protected void insert(int item)
insert in class AbstractSetitem - The item to insert.protected void withdraw(int item)
withdraw in class AbstractSetitem - The item to be withdrawn.protected boolean isMember(int item)
isMember in class AbstractSetitem - The item for which to look.public boolean isEmpty()
isEmpty in interface ContainerisEmpty in class AbstractContainerpublic boolean isFull()
isFull in interface ContainerisFull in class AbstractContainerpublic void purge()
purge in interface Containerpublic void accept(Visitor visitor)
accept in interface Containeraccept in class AbstractContainervisitor - The visitor to accept.public int getCount()
getCount in interface ContainergetCount in class AbstractContainerpublic Set union(Set set)
SetAsBitVector class.union in interface Setset - The set to join with this set.java.lang.IllegalArgumentException - If the sizes of the universal sets differ.public Set intersection(Set set)
SetAsBitVector class.intersection in interface Setset - The set to intersect with this set.java.lang.IllegalArgumentException - If the sizes of the universal sets differ.public Set difference(Set set)
SetAsBitVector class.difference in interface Setset - The set to subtract from this set.java.lang.IllegalArgumentException - If the sizes of the universal sets differ.public boolean isSubset(Set set)
SetAsBitVector class.isSubset in interface Setset - The set to compare with this set.java.lang.IllegalArgumentException - If the sizes of the universal sets differ.public boolean isEQ(Set set)
SetAsBitVector class.isEQ in interface Setset - The set to compare with this set.java.lang.IllegalArgumentException - If the sizes of the universal sets differ.public Enumeration getEnumeration()
getEnumeration in interface Containerprotected int compareTo(Comparable arg)
compareTo in class AbstractObjectarg - The comparable object to compare with this set.MethodNotImplemented - Alwys.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||