org.axiondb.engine.rowcollection
Class IntSet

java.lang.Object
  extended by org.axiondb.engine.rowcollection.IntSet
All Implemented Interfaces:
org.apache.commons.collections.primitives.IntCollection

public class IntSet
extends java.lang.Object
implements org.apache.commons.collections.primitives.IntCollection

An int set that uses IntHashMap to keep ids.


Constructor Summary
IntSet()
          Constructs a new, empty set; the backing HashMap instance has default initial capacity (16) and load factor (0.75).
IntSet(int initialCapacity)
          Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and default load factor, which is 0.75.
 
Method Summary
 boolean add(int id)
          Adds the specified element to this set if it is not already present.
 boolean addAll(org.apache.commons.collections.primitives.IntCollection c)
           
 void clear()
          Removes all of the elements from this set.
 boolean contains(int id)
          Returns true if this set contains the specified element.
 boolean containsAll(org.apache.commons.collections.primitives.IntCollection c)
           
 boolean isEmpty()
          Returns true if this set contains no elements.
 org.apache.commons.collections.primitives.IntIterator iterator()
           
 org.apache.commons.collections.primitives.IntListIterator listIterator()
           
 boolean remove(int id)
          Removes the specified element from this set if it is present.
 boolean removeAll(org.apache.commons.collections.primitives.IntCollection c)
           
 boolean removeElement(int element)
           
 boolean retainAll(org.apache.commons.collections.primitives.IntCollection c)
           
 int size()
          Returns the number of elements in this set (its cardinality).
 int[] toArray()
           
 int[] toArray(int[] a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntSet

public IntSet()
Constructs a new, empty set; the backing HashMap instance has default initial capacity (16) and load factor (0.75).


IntSet

public IntSet(int initialCapacity)
Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and default load factor, which is 0.75.

Parameters:
initialCapacity - the initial capacity of the hash table.
Throws:
java.lang.IllegalArgumentException - if the initial capacity is less than zero.
Method Detail

add

public boolean add(int id)
Adds the specified element to this set if it is not already present.

Specified by:
add in interface org.apache.commons.collections.primitives.IntCollection
Parameters:
id - element to be added to this set.
Returns:
true if the set did not already contain the specified element.

clear

public void clear()
Removes all of the elements from this set.

Specified by:
clear in interface org.apache.commons.collections.primitives.IntCollection

contains

public boolean contains(int id)
Returns true if this set contains the specified element.

Specified by:
contains in interface org.apache.commons.collections.primitives.IntCollection
Parameters:
id - element whose presence in this set is to be tested.
Returns:
true if this set contains the specified element.

isEmpty

public boolean isEmpty()
Returns true if this set contains no elements.

Specified by:
isEmpty in interface org.apache.commons.collections.primitives.IntCollection
Returns:
true if this set contains no elements.

iterator

public org.apache.commons.collections.primitives.IntIterator iterator()
Specified by:
iterator in interface org.apache.commons.collections.primitives.IntCollection

listIterator

public org.apache.commons.collections.primitives.IntListIterator listIterator()

remove

public boolean remove(int id)
Removes the specified element from this set if it is present.

Parameters:
id - object to be removed from this set, if present.
Returns:
true if the set contained the specified element.

size

public int size()
Returns the number of elements in this set (its cardinality).

Specified by:
size in interface org.apache.commons.collections.primitives.IntCollection
Returns:
the number of elements in this set (its cardinality).

addAll

public boolean addAll(org.apache.commons.collections.primitives.IntCollection c)
Specified by:
addAll in interface org.apache.commons.collections.primitives.IntCollection

containsAll

public boolean containsAll(org.apache.commons.collections.primitives.IntCollection c)
Specified by:
containsAll in interface org.apache.commons.collections.primitives.IntCollection

removeAll

public boolean removeAll(org.apache.commons.collections.primitives.IntCollection c)
Specified by:
removeAll in interface org.apache.commons.collections.primitives.IntCollection

removeElement

public boolean removeElement(int element)
Specified by:
removeElement in interface org.apache.commons.collections.primitives.IntCollection

retainAll

public boolean retainAll(org.apache.commons.collections.primitives.IntCollection c)
Specified by:
retainAll in interface org.apache.commons.collections.primitives.IntCollection

toArray

public int[] toArray()
Specified by:
toArray in interface org.apache.commons.collections.primitives.IntCollection

toArray

public int[] toArray(int[] a)
Specified by:
toArray in interface org.apache.commons.collections.primitives.IntCollection