org.axiondb.engine.rowcollection

Class IntSet

public class IntSet extends Object implements IntCollection

An int set that uses IntHashMap to keep ids.

Author: Ahimanikya Satapathy

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
booleanadd(int id)
Adds the specified element to this set if it is not already present.
booleanaddAll(IntCollection c)
voidclear()
Removes all of the elements from this set.
booleancontains(int id)
Returns true if this set contains the specified element.
booleancontainsAll(IntCollection c)
booleanisEmpty()
Returns true if this set contains no elements.
IntIteratoriterator()
IntListIteratorlistIterator()
booleanremove(int id)
Removes the specified element from this set if it is present.
booleanremoveAll(IntCollection c)
booleanremoveElement(int element)
booleanretainAll(IntCollection c)
intsize()
Returns the number of elements in this set (its cardinality).
int[]toArray()
int[]toArray(int[] a)

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: 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.

Parameters: id element to be added to this set.

Returns: true if the set did not already contain the specified element.

addAll

public boolean addAll(IntCollection c)

clear

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

contains

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

Parameters: id element whose presence in this set is to be tested.

Returns: true if this set contains the specified element.

containsAll

public boolean containsAll(IntCollection c)

isEmpty

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

Returns: true if this set contains no elements.

iterator

public IntIterator iterator()

listIterator

public 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.

removeAll

public boolean removeAll(IntCollection c)

removeElement

public boolean removeElement(int element)

retainAll

public boolean retainAll(IntCollection c)

size

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

Returns: the number of elements in this set (its cardinality).

toArray

public int[] toArray()

toArray

public int[] toArray(int[] a)