APIdia Launch Partner
Top Description Fields Constructors Methods
java.text

pack-priv final Class RuleBasedCollationKey

extends CollationKey
Class Inheritance

A RuleBasedCollationKey is a concrete implementation of CollationKey class. The RuleBasedCollationKey class is used by the RuleBasedCollator class.

Field Summary

Modifier and TypeField and Description
private String

Constructor Summary

AccessConstructor and Description
pack-priv
RuleBasedCollationKey(String source, String key)

A RuleBasedCollationKey can only be generated by Collator objects.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

Returns an integer value. Value is less than zero if this is less than target, value is zero if this and target are equal and value is greater than zero if this is greater than target.
compareTo
(CollationKey
target RuleBasedCollationKey
target
)

Implements abstract java.text.CollationKey.compareTo.

Implements java.lang.Comparable.compareTo.

Compare this RuleBasedCollationKey to target.

public boolean

Returns:

Returns true if two objects are equal, false otherwise.
equals
(Object
the RuleBasedCollationKey to compare to.
target
)

Overrides java.lang.Object.equals.

Compare this RuleBasedCollationKey and the target for equality.

public int

Returns:

the hash value based on the string's collation order.
hashCode
()

Overrides java.lang.Object.hashCode.

Creates a hash code for this RuleBasedCollationKey.

public byte[]
toByteArray()

Implements abstract java.text.CollationKey.toByteArray.

Converts the RuleBasedCollationKey to a sequence of bits.

Inherited from java.text.CollationKey:
getSourceString

Field Detail

keyback to summary
private String key

Constructor Detail

RuleBasedCollationKeyback to summary
pack-priv RuleBasedCollationKey(String source, String key)

A RuleBasedCollationKey can only be generated by Collator objects.

Method Detail

compareToback to summary
public int compareTo(CollationKey target)

Implements abstract java.text.CollationKey.compareTo.

Implements java.lang.Comparable.compareTo.

Compare this RuleBasedCollationKey to target. The collation rules of the Collator object which created these keys are applied

Note

RuleBasedCollationKeys created by different Collators can not be compared.

Parameters
target:CollationKey

target RuleBasedCollationKey

Returns:int

Returns an integer value. Value is less than zero if this is less than target, value is zero if this and target are equal and value is greater than zero if this is greater than target.

See Also
java.text.Collator#compare
equalsback to summary
public boolean equals(Object target)

Overrides java.lang.Object.equals.

Compare this RuleBasedCollationKey and the target for equality. The collation rules of the Collator object which created these keys are applied

Note

RuleBasedCollationKeys created by different Collators can not be compared.

Parameters
target:Object

the RuleBasedCollationKey to compare to.

Returns:boolean

Returns true if two objects are equal, false otherwise.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Creates a hash code for this RuleBasedCollationKey. The hash value is calculated on the key itself, not the String from which the key was created. Thus if x and y are RuleBasedCollationKeys, then x.hashCode(x) == y.hashCode() if x.equals(y) is true. This allows language-sensitive comparison in a hash table. See the CollatinKey class description for an example.

Returns:int

the hash value based on the string's collation order.

toByteArrayback to summary
public byte[] toByteArray()

Implements abstract java.text.CollationKey.toByteArray.

Converts the RuleBasedCollationKey to a sequence of bits. If two RuleBasedCollationKeys could be legitimately compared, then one could compare the byte arrays for each of those keys to obtain the same result. Byte arrays are organized most significant byte first.