net.sf.saxon.sort
Class IntArraySet

java.lang.Object
  extended bynet.sf.saxon.sort.IntArraySet
All Implemented Interfaces:
java.io.Serializable

public class IntArraySet
extends java.lang.Object
implements java.io.Serializable

Set of int values. This class is modelled on the java.net.Set interface, but it does not implement this interface, because the set members are int's rather than Objects. It does implement the same interface as IntHashSet, although this is currently not defined as an explicit interface.

This implementation of a set of integers is optimized to use very little storage and to provide fast comparison of two sets. The equals() method determines whether two sets contain the same integers.

Not thread safe.

See Also:
Serialized Form

Constructor Summary
IntArraySet()
          Create an empty set
IntArraySet(IntHashSet input)
          Create a set containing integers from the specified IntHashSet
 
Method Summary
 boolean add(int value)
           
 void clear()
           
 boolean contains(int value)
           
 boolean equals(java.lang.Object other)
          Test whether this set has exactly the same members as another set
 int[] getValues()
           
 int hashCode()
          Construct a hash key that supports the equals() test
 boolean isEmpty()
           
 IntIterator iterator()
          Get an iterator over the values
 boolean remove(int value)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntArraySet

public IntArraySet()
Create an empty set


IntArraySet

public IntArraySet(IntHashSet input)
Create a set containing integers from the specified IntHashSet

Method Detail

clear

public void clear()

size

public int size()

isEmpty

public boolean isEmpty()

getValues

public int[] getValues()

contains

public boolean contains(int value)

remove

public boolean remove(int value)

add

public boolean add(int value)

iterator

public IntIterator iterator()
Get an iterator over the values


equals

public boolean equals(java.lang.Object other)
Test whether this set has exactly the same members as another set


hashCode

public int hashCode()
Construct a hash key that supports the equals() test