"

2013 FRC Java API

"

com.sun.squawk.util
Class IntSet

java.lang.Object
  extended by com.sun.squawk.util.IntSet

public final class IntSet
extends Object

The IntSet class is an unsynchronized set of integers. The main operations are add, remove, size, and getInts.


Field Summary
protected  int elementCount
          The number of valid components in the vector.
protected  int[] elementData
          The array buffer into which the components of the vector are stored.
 
Constructor Summary
IntSet()
          Constructs an empty vector.
IntSet(int initialCapacity)
          Constructs an empty vector with the specified initial capacity and capacity increment.
 
Method Summary
 void add(int val)
          Adds the specified int to this set,, increasing its size by one.
 boolean contains(int elem)
          Tests if the specified object is a component in this vector.
 int[] getElements()
          Returns the underlying int array.
 boolean remove(int val)
          Removes the first occurrence of the argument from this set.
 void removeAll()
          Removes all components from this vector and sets its size to zero.
 int size()
          Returns the number of components in this set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elementData

protected int[] elementData
The array buffer into which the components of the vector are stored. The capacity of the vector is the length of this array buffer.


elementCount

protected int elementCount
The number of valid components in the vector.

Constructor Detail

IntSet

public IntSet(int initialCapacity)
Constructs an empty vector with the specified initial capacity and capacity increment.

Parameters:
initialCapacity - the initial capacity of the vector.
Throws:
IllegalArgumentException - if the specified initial capacity is negative

IntSet

public IntSet()
Constructs an empty vector.

Method Detail

getElements

public int[] getElements()
Returns the underlying int array. Only iterate over first size() elements.

Returns:
underlying int array

size

public final int size()
Returns the number of components in this set.

Returns:
the number of components in this set.

contains

public final boolean contains(int elem)
Tests if the specified object is a component in this vector.

Parameters:
elem - an object.
Returns:
true if the specified object is a component in this vector; false otherwise.

add

public void add(int val)
Adds the specified int to this set,, increasing its size by one.

Parameters:
val - the component to be added.

remove

public boolean remove(int val)
Removes the first occurrence of the argument from this set.

Parameters:
val - the component to be removed.
Returns:
true if the argument was a component of this set; false otherwise.

removeAll

public void removeAll()
Removes all components from this vector and sets its size to zero.


"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"