All Packages Class Hierarchy This Package Previous Next Index
Class java.text.CollatedString
java.lang.Object
|
+----java.text.CollatedString
- public final class CollatedString
- extends Object
Wrapper to allow strings in a hash table or binary tree table to be compared
internationally. The same collation is shared by all of the CollatedString
objects in the table.
Example of use:
CollatedString myStr = new ("This is a String", Collation.getDefault());
int myStrHash = myStr.hashCode();
- See Also:
- Collation
-
CollatedString(String, Collation)
- The CollatedString constructor takes the string value and the
collation object to create the collated string with.
-
equals(Object)
- Compare if two objects are the same.
-
getCollation()
- Get the current collation object.
-
getString()
- Get the current string that the collated string represents.
-
greater(Object)
- Compare if this is greater than the source object.
-
greaterOrEqual(Object)
- Compare if this is greater than or equal to the source object.
-
hashCode()
- Returns the hash code of the string based on the collation rules.
-
setCollation(Collation)
- Set the current collation object to a new collation object.
-
setString(String)
- Change the current collated string value to a new string.
CollatedString
public CollatedString(String value,
Collation comparison)
- The CollatedString constructor takes the string value and the
collation object to create the collated string with. A collation
object defines how a string is collated internationally.
- Parameters:
- value - the string to be used to create the collated string with.
- comparison - the collation object.
setString
public void setString(String value)
- Change the current collated string value to a new string.
- Parameters:
- value - the new string to be used to create the collated string
with.
- See Also:
- getString
getString
public String getString()
- Get the current string that the collated string represents.
- Returns:
- the string value of the collated string.
- See Also:
- setString
setCollation
public void setCollation(Collation comparison)
- Set the current collation object to a new collation object. A
collation object defines how a string is collated internationally.
- Parameters:
- comparison - the new collation object.
- See Also:
- getCollation
getCollation
public Collation getCollation()
- Get the current collation object. A collation object defines how
a string is collated internationally.
- Returns:
- the collation object that is currently used by the collated
string.
- See Also:
- setCollation
hashCode
public int hashCode()
- Returns the hash code of the string based on the collation rules.
- Returns:
- the hash code of a collated string.
- Overrides:
- hashCode in class Object
- See Also:
- hashCode
equals
public boolean equals(Object source)
- Compare if two objects are the same.
- Parameters:
- source - object to compare to
- Returns:
- true if this is equal to source, false otherwise
- Overrides:
- equals in class Object
greater
public boolean greater(Object source)
- Compare if this is greater than the source object.
- Parameters:
- source - object to compare to
- Returns:
- true if this is greater than source, false otherwise
greaterOrEqual
public boolean greaterOrEqual(Object source)
- Compare if this is greater than or equal to the source object.
- Parameters:
- source - object to compare to
- Returns:
- true if this is greater than or equal to source, false
otherwise
All Packages Class Hierarchy This Package Previous Next Index