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

Constructor Index

 o CollatedString(String, Collation)
The CollatedString constructor takes the string value and the collation object to create the collated string with.

Method Index

 o equals(Object)
Compare if two objects are the same.
 o getCollation()
Get the current collation object.
 o getString()
Get the current string that the collated string represents.
 o greater(Object)
Compare if this is greater than the source object.
 o greaterOrEqual(Object)
Compare if this is greater than or equal to the source object.
 o hashCode()
Returns the hash code of the string based on the collation rules.
 o setCollation(Collation)
Set the current collation object to a new collation object.
 o setString(String)
Change the current collated string value to a new string.

Constructors

 o 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.

Methods

 o 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
 o getString
  public String getString()
Get the current string that the collated string represents.

Returns:
the string value of the collated string.
See Also:
setString
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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