javax.slee.profile.query
Class QueryCollator

java.lang.Object
  extended by javax.slee.profile.query.QueryCollator
All Implemented Interfaces:
java.io.Serializable

public final class QueryCollator
extends java.lang.Object
implements java.io.Serializable

The QueryCollator class describes a collator that can be used in dynamic profile queries in a Java serializable form.

See Also:
Serialized Form

Constructor Summary
QueryCollator(java.util.Locale locale)
          Create a collator identified by locale only.
QueryCollator(java.util.Locale locale, int strength)
          Create a collator for a given locale using the specified strength.
QueryCollator(java.util.Locale locale, int strength, int decomposition)
          Create a collator for a given locale using the specified strength and decomposition.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare this query collator for equality with another object.
 java.text.Collator getCollator()
          Get the java.text.Collator described by this QueryCollator object.
 int getDecomposition()
          Get the decomposition mode specified for this collator.
 java.util.Locale getLocale()
          Get the locale for this collator.
 int getStrength()
          Get the collator strength specified for this collator.
 boolean hasDecomposition()
          Determine whether a decomposition mode has been defined for this collator.
 int hashCode()
          Get a hash code value for this query collator.
 boolean hasStrength()
          Determine whether a collator strength has been defined for this collator.
 java.lang.String toString()
          Get a string representation for this query collator.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryCollator

public QueryCollator(java.util.Locale locale)
Create a collator identified by locale only. The collator uses the default strength and decomposition for the locale.

Parameters:
locale - the locale for which the collator should be obtained.
Throws:
java.lang.NullPointerException - if locale is null.

QueryCollator

public QueryCollator(java.util.Locale locale,
                     int strength)
Create a collator for a given locale using the specified strength. The collator uses the default decomposition for the locale.

Parameters:
locale - the locale for which the collator should be obtained.
strength - the strength of collator comparisions. This must be one of Collator.PRIMARY, Collator.SECONDARY, Collator.TERTIARY, or Collator.IDENTICAL.
Throws:
java.lang.NullPointerException - if locale is null.

QueryCollator

public QueryCollator(java.util.Locale locale,
                     int strength,
                     int decomposition)
Create a collator for a given locale using the specified strength and decomposition.

Parameters:
locale - the locale for which the collator should be obtained.
strength - the strength of collator comparisions. This must be one of Collator.PRIMARY, Collator.SECONDARY, Collator.TERTIARY, or Collator.IDENTICAL.
decomposition - the decomposition mode to use in the collator. This must be one of Collator.NO_DECOMPOSITION, Collator.CANONICAL_DECOMPOSITION, or Collator.FULL_DECOMPOSITION.
Throws:
java.lang.NullPointerException - if locale is null.
Method Detail

getLocale

public java.util.Locale getLocale()
Get the locale for this collator.

Returns:
the locale for this collator.

hasStrength

public boolean hasStrength()
Determine whether a collator strength has been defined for this collator.

Returns:
true if a collator strength has been defined for this collator, false otherwise.

getStrength

public int getStrength()
Get the collator strength specified for this collator. The return value only has meaning if hasStrength() == true.

Returns:
the collator strength specified for this collator.

hasDecomposition

public boolean hasDecomposition()
Determine whether a decomposition mode has been defined for this collator.

Returns:
true if a decomposition mode has been defined for this collator, false otherwise.

getDecomposition

public int getDecomposition()
Get the decomposition mode specified for this collator. The return value only has meaning if hasDecomposition() == true.

Returns:
the decomposition mode specified for this collator.

getCollator

public java.text.Collator getCollator()
Get the java.text.Collator described by this QueryCollator object.

Returns:
the Collator described by this object.

equals

public boolean equals(java.lang.Object obj)
Compare this query collator for equality with another object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this with.
Returns:
true if obj is a QueryCollator with the same locale, strength, and decomposition properties as this, false otherwise.

hashCode

public int hashCode()
Get a hash code value for this query collator.

Overrides:
hashCode in class java.lang.Object
Returns:
as hash code. The hash code is equal to the hash code of the collator's locale.

toString

public java.lang.String toString()
Get a string representation for this query collator.

Overrides:
toString in class java.lang.Object
Returns:
a string representation for this query collator.


Copyright © 2008. All Rights Reserved.