public class IntSet
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
IntSet.Entry<V> |
static class |
IntSet.IntSetIterator |
Modifier and Type | Field and Description |
---|---|
int |
size |
Constructor and Description |
---|
IntSet()
Creates a new sets with an initial capacity of 32 and a load factor of 0.8.
|
IntSet(int initialCapacity)
Creates a new set with a load factor of 0.8.
|
IntSet(int initialCapacity,
float loadFactor)
Creates a new set with the specified initial capacity and load factor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(int key)
Returns true if the key was not already in the set.
|
void |
clear() |
void |
clear(int maximumCapacity)
Clears the map and reduces the size of the backing arrays to be the specified capacity if they are larger.
|
boolean |
contains(int key) |
void |
ensureCapacity(int additionalCapacity)
Increases the size of the backing array to acommodate the specified number of additional items.
|
IntSet.IntSetIterator |
iterator()
Returns an iterator for the keys in the set.
|
void |
putAll(IntSet set) |
boolean |
remove(int key)
Returns true if the key was removed.
|
void |
shrink(int maximumCapacity)
Reduces the size of the backing arrays to be the specified capacity or less.
|
java.lang.String |
toString() |
public IntSet()
public IntSet(int initialCapacity)
public IntSet(int initialCapacity, float loadFactor)
public boolean add(int key)
public void putAll(IntSet set)
public boolean remove(int key)
public void shrink(int maximumCapacity)
public void clear(int maximumCapacity)
public void clear()
public boolean contains(int key)
public void ensureCapacity(int additionalCapacity)
public java.lang.String toString()
toString
in class java.lang.Object
public IntSet.IntSetIterator iterator()
IntSet.IntSetIterator
constructor for nested or multithreaded iteration.