Class IntSet

java.lang.Object
   |
   +----IntSet

public class IntSet
extends Object
implements Cloneable
A set of non-negative (small) int's. The set automatically grows. Based on java.util.BitSet.


Constructor Index

 o IntSet()
Creates an empty set.
 o IntSet(int)
Initialize with 1 number in the set
 o IntSet(int, int)
Initialize with 2 numbers in the set
 o IntSet(int, int, int)
Initialize with 3 numbers in the set
 o IntSet(int, int, int, int)
Initialize with 4 numbers in the set
 o IntSet(int, int, int, int, int)
Initialize with 5 numbers in the set
 o IntSet(int, int, int, int, int, int)
Initialize with 6 numbers in the set
 o IntSet(int, int, int, int, int, int, int)
Initialize with 7 numbers in the set
 o IntSet(int, int, int, int, int, int, int, int)
Initialize with 8 numbers in the set
 o IntSet(int, int, int, int, int, int, int, int, int)
Initialize with 9 numbers in the set
 o IntSet(int, int, int, int, int, int, int, int, int, int)
Initialize with 10 numbers in the set
 o IntSet(int, int, int, int, int, int, int, int, int, int, int)
Initialize with 11 numbers in the set
 o IntSet(int, int, int, int, int, int, int, int, int, int, int, int)
Initialize with 12 numbers in the set
 o IntSet(int[])
Creates a set initialized from an array of integers.

Method Index

 o add(int)
Adds a number
 o add(IntSet)
Add a set to the current set.
 o clone()
Clones the IntSet.
 o delete(int)
Removes a number
 o delete(IntSet)
Delete all members of a set from the current set.
 o equals(Object)
Compares this object against the specified object.
 o hashCode()
Gets the hashcode.
 o hasMember(int)
Checks for presence of a number
 o restrictTo(IntSet)
Restrict the set to the intersection with another set
 o size()
Calculates and returns the set's size
 o toString()
Converts the IntSet to a String.

Constructors

 o IntSet
 public IntSet()
Creates an empty set.

 o IntSet
 public IntSet(int x[])
Creates a set initialized from an array of integers.

Parameters:
x - the array of integers to intialize from
 o IntSet
 public IntSet(int n0,
               int n1,
               int n2,
               int n3,
               int n4,
               int n5,
               int n6,
               int n7,
               int n8,
               int n9,
               int n10,
               int n11)
Initialize with 12 numbers in the set

 o IntSet
 public IntSet(int n0,
               int n1,
               int n2,
               int n3,
               int n4,
               int n5,
               int n6,
               int n7,
               int n8,
               int n9,
               int n10)
Initialize with 11 numbers in the set

 o IntSet
 public IntSet(int n0,
               int n1,
               int n2,
               int n3,
               int n4,
               int n5,
               int n6,
               int n7,
               int n8,
               int n9)
Initialize with 10 numbers in the set

 o IntSet
 public IntSet(int n0,
               int n1,
               int n2,
               int n3,
               int n4,
               int n5,
               int n6,
               int n7,
               int n8)
Initialize with 9 numbers in the set

 o IntSet
 public IntSet(int n0,
               int n1,
               int n2,
               int n3,
               int n4,
               int n5,
               int n6,
               int n7)
Initialize with 8 numbers in the set

 o IntSet
 public IntSet(int n0,
               int n1,
               int n2,
               int n3,
               int n4,
               int n5,
               int n6)
Initialize with 7 numbers in the set

 o IntSet
 public IntSet(int n0,
               int n1,
               int n2,
               int n3,
               int n4,
               int n5)
Initialize with 6 numbers in the set

 o IntSet
 public IntSet(int n0,
               int n1,
               int n2,
               int n3,
               int n4)
Initialize with 5 numbers in the set

 o IntSet
 public IntSet(int n0,
               int n1,
               int n2,
               int n3)
Initialize with 4 numbers in the set

 o IntSet
 public IntSet(int n0,
               int n1,
               int n2)
Initialize with 3 numbers in the set

 o IntSet
 public IntSet(int n0,
               int n1)
Initialize with 2 numbers in the set

 o IntSet
 public IntSet(int n0)
Initialize with 1 number in the set

Methods

 o add
 public IntSet add(int x)
Adds a number

Parameters:
x - the number to add
 o delete
 public IntSet delete(int x)
Removes a number

Parameters:
x - the number to remove
 o hasMember
 public boolean hasMember(int x)
Checks for presence of a number

Parameters:
x - the number to check
 o restrictTo
 public IntSet restrictTo(IntSet set)
Restrict the set to the intersection with another set

Parameters:
set - the set to intersect with
 o add
 public IntSet add(IntSet set)
Add a set to the current set.

Parameters:
set - the set to be added
 o delete
 public IntSet delete(IntSet set)
Delete all members of a set from the current set.

Parameters:
set - the set to be removed
 o hashCode
 public int hashCode()
Gets the hashcode.

Overrides:
hashCode in class Object
 o size
 public int size()
Calculates and returns the set's size

 o equals
 public boolean equals(Object obj)
Compares this object against the specified object.

Parameters:
obj - the object to commpare with
Returns:
true if the objects are the same; false otherwise.
Overrides:
equals in class Object
 o clone
 public Object clone()
Clones the IntSet.

Overrides:
clone in class Object
 o toString
 public String toString()
Converts the IntSet to a String.

Overrides:
toString in class Object