|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object
|
+--com.sosnoski.util.ObjectHashBase
|
+--com.sosnoski.util.hashset.ObjectSetBase
|
+--com.sosnoski.util.hashset.StringHashSet
Hash set of Strings. This implementation is unsynchronized
in order to provide the best possible performance for typical usage
scenarios, so explicit synchronization must be implemented by a wrapper
class or directly by the application in cases where instances are modified
in a multithreaded environment. See the base classes for other details of
the implementation.
| Field Summary | |
protected boolean |
m_identCompare
Use identity comparison flag. |
protected boolean |
m_identHash
Use identity hash flag. |
protected java.lang.String[] |
m_keyTable
Array of value table slots. |
| Fields inherited from class com.sosnoski.util.ObjectHashBase |
DEFAULT_FILL, IDENTITY_COMP, IDENTITY_HASH, m_arraySize, m_entryCount, m_entryLimit, m_fillFraction, m_hitOffset, MINIMUM_SIZE, STANDARD_HASH |
| Constructor Summary | |
StringHashSet()
Default constructor. |
|
StringHashSet(int count)
Constructor with only size supplied. |
|
StringHashSet(int count,
double fill)
Constructor with size and fill fraction supplied. |
|
StringHashSet(int count,
double fill,
java.lang.Object tech)
Constructor with full specification. |
|
StringHashSet(int count,
java.lang.Object tech)
Constructor with size and technique supplied. |
|
StringHashSet(java.lang.Object tech)
Constructor with only technique supplied. |
|
StringHashSet(StringHashSet base)
Copy (clone) constructor. |
|
| Method Summary | |
boolean |
add(java.lang.String key)
Add a key to the set. |
protected int |
assignSlot(java.lang.String key)
Assign slot for entry. |
java.lang.Object |
clone()
Construct a copy of the set. |
boolean |
contains(java.lang.String key)
Check if key is in set. |
protected java.lang.Object[] |
getKeyArray()
Get the backing array of keys. |
protected boolean |
reinsert(int slot)
Reinsert a key into the hash set. |
boolean |
remove(java.lang.String key)
Remove an entry from the set. |
protected void |
restructure(java.lang.Object karray)
Restructure the set. |
protected void |
setKeyArray(java.lang.Object array)
Set the backing array of keys. |
| Methods inherited from class com.sosnoski.util.hashset.ObjectSetBase |
internalRemove, iterator, reallocate |
| Methods inherited from class com.sosnoski.util.ObjectHashBase |
clear, ensureCapacity, freeSlot, growCapacity, size, standardFind, standardSlot, stepSlot |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String[] m_keyTable
protected boolean m_identHash
protected boolean m_identCompare
| Constructor Detail |
public StringHashSet(int count,
double fill,
java.lang.Object tech)
count - number of values to assume in initial sizing of setfill - fraction full allowed for set before growingtech - hash technique specifier (one of STANDARD_HASH,
IDENTITY_COMP, or IDENTITY_HASH, inherited from
ObjectHashBase)
public StringHashSet(int count,
double fill)
count - number of values to assume in initial sizing of setfill - fraction full allowed for set before growing
public StringHashSet(int count,
java.lang.Object tech)
count - number of values to assume in initial sizing of settech - hash technique specifier (one of STANDARD_HASH,
IDENTITY_COMP, or IDENTITY_HASH, inherited from
ObjectHashBase)public StringHashSet(int count)
count - number of values to assume in initial sizing of setpublic StringHashSet(java.lang.Object tech)
tech - hash technique specifier (one of STANDARD_HASH,
IDENTITY_COMP, or IDENTITY_HASH, inherited from
ObjectHashBase)public StringHashSet()
public StringHashSet(StringHashSet base)
base - instance being copied| Method Detail |
protected java.lang.Object[] getKeyArray()
getKeyArray in class ObjectHashBaseprotected void setKeyArray(java.lang.Object array)
setKeyArray in class ObjectHashBasearray - backing key array objectprotected boolean reinsert(int slot)
reinsert in class ObjectSetBaseslot - position of key to be reinserted into hash settrue if the slot number used by the key has
has changed, false if notprotected void restructure(java.lang.Object karray)
restructure in class ObjectSetBasekarray - array of keysprotected int assignSlot(java.lang.String key)
key - key to be added to setpublic boolean add(java.lang.String key)
key - key to be added to settrue if key added to set, false if
already present in setpublic boolean contains(java.lang.String key)
key - key to be found in settrue if key found in set, false
if notpublic boolean remove(java.lang.String key)
key - key to be removed from settrue if key successfully removed from set,
false if key not found in setpublic java.lang.Object clone()
clone in class java.lang.Object
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||