|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.util.StringTable
public final class StringTable
Like a hash table, but built specifically for strings. Enumerates contents in order.
Constructor Summary | |
---|---|
StringTable()
Construct a string table using all defaults. |
|
StringTable(Collator collator)
Construct a string table using the specified collator. |
|
StringTable(int nStrength)
Construct a string table using the specified collator strength. |
Method Summary | |
---|---|
void |
add(String string)
Add the passed string to the table. |
boolean |
addAll(StringTable that)
Adds all of the nodes in the specified StringTable to this StringTable if they are not already present. |
void |
clear()
Remove all strings from the table. |
Object |
clone()
Make a new string table with a copy of the tree and a copy of the collator. |
boolean |
contains(String string)
Determine if the passed string is in the table. |
Enumeration |
elements()
Create an enumerator for the values in the table. |
boolean |
equals(Object obj)
Test for equality of two string tables. |
Object |
get(String string)
Find the specified string in the table and return its value. |
int |
getSize()
Determine the number of strings in the table. |
boolean |
isEmpty()
Test for empty table. |
Enumeration |
keys()
Enumerate the table's strings. |
boolean |
keysEquals(StringTable that)
Test for equality of the keys in two string tables. |
void |
put(String string,
Object value)
Add the passed string to the table and associate the passed value with the string. |
void |
putAll(StringTable that)
Puts all of the nodes in the specified StringTable to this StringTable including the ones that are already present. |
Object |
remove(String string)
Remove the specified string from the table, returning its associated value. |
boolean |
removeAll(StringTable that)
Removes from this StringTable all of its nodes that are contained in the specified StringTable. |
boolean |
retainAll(StringTable that)
Retains only the nodes in this StringTable that are contained in the specified StringTable. |
String[] |
strings()
Get the table's strings. |
String[] |
stringsStartingWith(String prefix)
Get the table's strings that start with a specific string. |
String |
toString()
Provide a string representation of the string table. |
Constructor Detail |
---|
public StringTable()
public StringTable(Collator collator)
collator
- an instance of java.text.Collator to use to compare
stringsCollator
public StringTable(int nStrength)
nStrength
- a valid value for java.text.CollatorCollator.setStrength(int)
,
Collator.PRIMARY
,
Collator.SECONDARY
,
Collator.TERTIARY
,
Collator.IDENTICAL
Method Detail |
---|
public void add(String string)
string
- the string to add to the tablepublic void put(String string, Object value)
string
- the string to add to the tablevalue
- the object to associate with the stringpublic Object get(String string)
string
- the string to look for in the table
public boolean contains(String string)
string
- the string to look for in the table
public Object remove(String string)
string
- the string to look for in the table
public void clear()
public int getSize()
public boolean isEmpty()
public String[] strings()
public String[] stringsStartingWith(String prefix)
public Enumeration keys()
public Enumeration elements()
public boolean addAll(StringTable that)
Collection.addAll(Collection)
public void putAll(StringTable that)
public boolean retainAll(StringTable that)
Collection.retainAll(Collection)
public boolean removeAll(StringTable that)
Collection.removeAll(Collection)
public String toString()
public boolean equals(Object obj)
obj
- the object to compare to
public boolean keysEquals(StringTable that)
that
- the string table to compare to
public Object clone()
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |