Hash
, java.io.Serializable
public class WorkbenchEntrySet extends java.lang.Object implements java.io.Serializable, Hash
Hash.Strategy<K extends java.lang.Object>
Modifier and Type | Field | Description |
---|---|---|
protected int |
mask |
The mask for wrapping a position counter.
|
protected int |
maxFill |
The maximum number of entries that can be filled before rehashing.
|
protected int |
n |
The current table size.
|
protected int |
size |
Number of entries in the set.
|
protected WorkbenchEntry[] |
workbenchEntry |
The array of keys.
|
DEFAULT_GROWTH_FACTOR, DEFAULT_INITIAL_SIZE, DEFAULT_LOAD_FACTOR, FAST_LOAD_FACTOR, FREE, OCCUPIED, PRIMES, REMOVED, VERY_FAST_LOAD_FACTOR
Constructor | Description |
---|---|
WorkbenchEntrySet() |
Creates a set of workbench entries.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
add(WorkbenchEntry e) |
Adds a workbench entry to the set, if necessary.
|
void |
clear() |
Removes all elements from this set.
|
void |
ensureCapacity(int capacity) |
Ensures that the set has a given capacity.
|
WorkbenchEntry |
get(byte[] address) |
Returns the entry for a given IP address.
|
boolean |
isEmpty() |
Returns whether the workbench is empty.
|
protected void |
rehash(int newN) |
Rehashes the set to a new size.
|
boolean |
remove(WorkbenchEntry e) |
Removes a given workbench entry.
|
protected int |
shiftKeys(int pos) |
Shifts left entries with the specified hash code, starting at the specified position, and
empties the resulting free entry.
|
int |
size() |
Returns the size (number of entries) in the workbench.
|
WorkbenchEntry[] |
workbenchEntries() |
Returns the array of workbench entries; the order is arbitrary.
|
protected transient WorkbenchEntry[] workbenchEntry
protected transient int n
protected transient int mask
protected int size
protected int maxFill
public WorkbenchEntry[] workbenchEntries()
null
elements.null
entries.public void ensureCapacity(int capacity)
capacity
- the desired capacity.public boolean add(WorkbenchEntry e)
e
- the entry to be added.protected final int shiftKeys(int pos)
pos
- a starting position.public boolean remove(WorkbenchEntry e)
e
- the workbench entry to be removed.public WorkbenchEntry get(byte[] address)
address
- the IP address.null
.public void clear()
To increase object reuse, this method does not change the table size.
public int size()
public boolean isEmpty()
protected void rehash(int newN)
newN
- the new size.