coins.backend.util
Class VectorSet

java.lang.Object
  extended bycoins.backend.util.VectorSet
All Implemented Interfaces:
NumberSet

public class VectorSet
extends java.lang.Object
implements NumberSet

Set of small integers represented in arrays.


Nested Class Summary
static class VectorSet.Iterator
           
 
Constructor Summary
VectorSet(int max)
          Create a set of numbers which is supposed to be less than max
 
Method Summary
 void add(int x)
          Add number x to set.
 void addAll(NumberSet x)
          Add all elements of another NumberSet x to this set.
 void addAllTo(NumberSet x)
          Add all elements of this set to another NumberSet x.
 void clear()
          Clear contents of set.
 java.lang.Object clone()
          Return copy of the object.
 boolean contains(int x)
          Return true if x is in the set.
 void copy(NumberSet x)
          Copy another NumberSet x to this object.
 boolean equals(java.lang.Object x)
          Return true if x is same as this set.
 NumberSet.Iterator iterator()
          Enumerate all members.
 void remove(int x)
          Remove number x from set.
 void removeAll(NumberSet x)
          Remove all elements of another NumberSet x from this set.
 void removeAllFrom(NumberSet x)
          Remove all elements of this set from another NumberSet x.
 int size()
          Return the number of elements.
 void toArray(int[] a)
          Convert to array
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorSet

public VectorSet(int max)
Create a set of numbers which is supposed to be less than max

Method Detail

size

public int size()
Return the number of elements.

Specified by:
size in interface NumberSet

clear

public void clear()
Clear contents of set.

Specified by:
clear in interface NumberSet

add

public void add(int x)
Add number x to set.

Specified by:
add in interface NumberSet

addAll

public void addAll(NumberSet x)
Add all elements of another NumberSet x to this set.

Specified by:
addAll in interface NumberSet

addAllTo

public void addAllTo(NumberSet x)
Add all elements of this set to another NumberSet x.

Specified by:
addAllTo in interface NumberSet

remove

public void remove(int x)
Remove number x from set.

Specified by:
remove in interface NumberSet

removeAll

public void removeAll(NumberSet x)
Remove all elements of another NumberSet x from this set.

Specified by:
removeAll in interface NumberSet

removeAllFrom

public void removeAllFrom(NumberSet x)
Remove all elements of this set from another NumberSet x.

Specified by:
removeAllFrom in interface NumberSet

contains

public boolean contains(int x)
Return true if x is in the set.

Specified by:
contains in interface NumberSet

iterator

public NumberSet.Iterator iterator()
Enumerate all members.

Specified by:
iterator in interface NumberSet

toArray

public void toArray(int[] a)
Convert to array

Specified by:
toArray in interface NumberSet

copy

public void copy(NumberSet x)
Copy another NumberSet x to this object.

Specified by:
copy in interface NumberSet

equals

public boolean equals(java.lang.Object x)
Return true if x is same as this set.

Specified by:
equals in interface NumberSet

clone

public java.lang.Object clone()
Return copy of the object.

Specified by:
clone in interface NumberSet