public final class IntSet
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
IntSet.Entry
The structure used for chaining colliding keys.
|
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
EOL |
private IntSet.Entry[] |
m_buckets |
private float |
m_loadFactor |
private int |
m_size |
private int |
m_sizeThreshold |
Constructor and Description |
---|
IntSet()
Equivalent to
IntSet(11, 0.75F) . |
IntSet(int initialCapacity)
Equivalent to
IntSet(capacity, 0.75F) . |
IntSet(int initialCapacity,
float loadFactor)
Constructs an IntSet with specified initial capacity and load factor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(int key) |
boolean |
contains(int key) |
(package private) void |
debugDump(java.lang.StringBuffer out) |
private void |
rehash()
Re-hashes the table into a new array of buckets.
|
int |
size()
Returns the number of key-value mappings in this map.
|
java.lang.String |
toString()
Overrides Object.toString() for debug purposes.
|
int[] |
values() |
void |
values(int[] target,
int offset) |
private final float m_loadFactor
private IntSet.Entry[] m_buckets
private int m_size
private int m_sizeThreshold
private static final java.lang.String EOL
public IntSet()
IntSet(11, 0.75F)
.public IntSet(int initialCapacity)
IntSet(capacity, 0.75F)
.public IntSet(int initialCapacity, float loadFactor)
initialCapacity
- initial number of hash buckets in the table [may not be negative, 0 is equivalent to 1].loadFactor
- the load factor to use to determine rehashing points [must be in (0.0, 1.0] range].public java.lang.String toString()
toString
in class java.lang.Object
public int size()
public boolean contains(int key)
public int[] values()
public void values(int[] target, int offset)
public boolean add(int key)
void debugDump(java.lang.StringBuffer out)
private void rehash()