public class StringSizedSet extends Object
String values.| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_FILL_FRACTION
Default fill fraction for sizing of tables.
|
protected int |
m_arraySize
Size of array used for keys.
|
protected int |
m_hitOffset
Offset added (modulo table size) to slot number on collision.
|
protected String[] |
m_keyTable
Array of key table slots.
|
| Constructor and Description |
|---|
StringSizedSet(int count)
Constructor with only value count specified.
|
StringSizedSet(int count,
double fill)
Constructor with full specification.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(String key)
Add a key to the set.
|
void |
clear()
Set the table to the empty state.
|
boolean |
contains(String key)
Check if an entry is present in the table.
|
public static final double DEFAULT_FILL_FRACTION
protected final int m_arraySize
protected final String[] m_keyTable
protected final int m_hitOffset
public StringSizedSet(int count,
double fill)
count - number of values to assume in sizing of tablefill - fraction fill for table (maximum of 0.7, to
prevent excessive collisions)public StringSizedSet(int count)
count - number of values to assume in initial sizing of tablepublic boolean add(String key)
key - key to be added to table (non-null)true if added, false if already present
value if key not previously present in tablepublic final boolean contains(String key)
key - key to be foundtrue if key found in table, false
if notpublic void clear()
Copyright © 2005–2016 jibx.org. All rights reserved.