Class RuleBasedCollatorICU
- All Implemented Interfaces:
Cloneable
public final class RuleBasedCollatorICU extends Object implements Cloneable
-
Field Summary
Fields Modifier and Type Field Description static intALTERNATE_HANDLINGstatic intCASE_FIRSTstatic intCASE_LEVELstatic intDECOMPOSITION_MODEstatic intFRENCH_COLLATIONstatic intSTRENGTHstatic intVALUE_ATTRIBUTE_VALUE_COUNTstatic intVALUE_DEFAULTstatic intVALUE_DEFAULT_STRENGTHstatic intVALUE_IDENTICALstatic intVALUE_LOWER_FIRSTstatic intVALUE_NON_IGNORABLEstatic intVALUE_OFFstatic intVALUE_ONstatic intVALUE_ON_WITHOUT_HANGULstatic intVALUE_PRIMARYstatic intVALUE_QUATERNARYstatic intVALUE_SECONDARYstatic intVALUE_SHIFTEDstatic intVALUE_TERTIARYstatic intVALUE_UPPER_FIRST -
Constructor Summary
Constructors Constructor Description RuleBasedCollatorICU(String rules)RuleBasedCollatorICU(Locale locale) -
Method Summary
Modifier and Type Method Description Objectclone()Creates and returns a copy of thisObject.intcompare(String source, String target)booleanequals(Object object)Compares this instance with the specified object and indicates if they are equal.booleanequals(String source, String target)protected voidfinalize()Invoked when the garbage collector has detected that this instance is no longer reachable.intgetAttribute(int type)CollationElementIteratorICUgetCollationElementIterator(String source)CollationElementIteratorICUgetCollationElementIterator(CharacterIterator it)CollationKeygetCollationKey(String source)intgetDecomposition()StringgetRules()intgetStrength()inthashCode()Returns an integer hash code for this object.voidsetAttribute(int type, int value)voidsetDecomposition(int mode)voidsetStrength(int strength)
-
Field Details
-
VALUE_DEFAULT
public static final int VALUE_DEFAULT- See Also:
- Constant Field Values
-
VALUE_PRIMARY
public static final int VALUE_PRIMARY- See Also:
- Constant Field Values
-
VALUE_SECONDARY
public static final int VALUE_SECONDARY- See Also:
- Constant Field Values
-
VALUE_TERTIARY
public static final int VALUE_TERTIARY- See Also:
- Constant Field Values
-
VALUE_DEFAULT_STRENGTH
public static final int VALUE_DEFAULT_STRENGTH- See Also:
- Constant Field Values
-
VALUE_QUATERNARY
public static final int VALUE_QUATERNARY- See Also:
- Constant Field Values
-
VALUE_IDENTICAL
public static final int VALUE_IDENTICAL- See Also:
- Constant Field Values
-
VALUE_OFF
public static final int VALUE_OFF- See Also:
- Constant Field Values
-
VALUE_ON
public static final int VALUE_ON- See Also:
- Constant Field Values
-
VALUE_SHIFTED
public static final int VALUE_SHIFTED- See Also:
- Constant Field Values
-
VALUE_NON_IGNORABLE
public static final int VALUE_NON_IGNORABLE- See Also:
- Constant Field Values
-
VALUE_LOWER_FIRST
public static final int VALUE_LOWER_FIRST- See Also:
- Constant Field Values
-
VALUE_UPPER_FIRST
public static final int VALUE_UPPER_FIRST- See Also:
- Constant Field Values
-
VALUE_ON_WITHOUT_HANGUL
public static final int VALUE_ON_WITHOUT_HANGUL- See Also:
- Constant Field Values
-
VALUE_ATTRIBUTE_VALUE_COUNT
public static final int VALUE_ATTRIBUTE_VALUE_COUNT- See Also:
- Constant Field Values
-
FRENCH_COLLATION
public static final int FRENCH_COLLATION- See Also:
- Constant Field Values
-
ALTERNATE_HANDLING
public static final int ALTERNATE_HANDLING- See Also:
- Constant Field Values
-
CASE_FIRST
public static final int CASE_FIRST- See Also:
- Constant Field Values
-
CASE_LEVEL
public static final int CASE_LEVEL- See Also:
- Constant Field Values
-
DECOMPOSITION_MODE
public static final int DECOMPOSITION_MODE- See Also:
- Constant Field Values
-
STRENGTH
public static final int STRENGTH- See Also:
- Constant Field Values
-
-
Constructor Details
-
RuleBasedCollatorICU
- Throws:
ParseException
-
RuleBasedCollatorICU
-
-
Method Details
-
clone
Description copied from class:ObjectCreates and returns a copy of thisObject. The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should callsuper.clone()to create the new instance and then create deep copies of the nested, mutable objects. -
compare
-
getDecomposition
public int getDecomposition() -
setDecomposition
public void setDecomposition(int mode) -
getStrength
public int getStrength() -
setStrength
public void setStrength(int strength) -
setAttribute
public void setAttribute(int type, int value) -
getAttribute
public int getAttribute(int type) -
getCollationKey
-
getRules
-
getCollationElementIterator
-
getCollationElementIterator
-
hashCode
public int hashCode()Description copied from class:ObjectReturns an integer hash code for this object. By contract, any two objects for whichObject.equals(java.lang.Object)returnstruemust return the same hash code value. This means that subclasses ofObjectusually override both methods or neither method.Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCodemethod if you intend implementing your ownhashCodemethod.- Overrides:
hashCodein classObject- Returns:
- this object's hash code.
- See Also:
Object.equals(java.lang.Object)
-
equals
-
equals
Description copied from class:ObjectCompares this instance with the specified object and indicates if they are equal. In order to be equal,omust represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.The default implementation returns
trueonly ifthis == o. See Writing a correctequalsmethod if you intend implementing your ownequalsmethod.The general contract for the
equalsandObject.hashCode()methods is that ifequalsreturnstruefor any two objects, thenhashCode()must return the same value for these objects. This means that subclasses ofObjectusually override either both methods or neither of them.- Overrides:
equalsin classObject- Parameters:
object- the object to compare this instance with.- Returns:
trueif the specified object is equal to thisObject;falseotherwise.- See Also:
Object.hashCode()
-
finalize
Description copied from class:ObjectInvoked when the garbage collector has detected that this instance is no longer reachable. The default implementation does nothing, but this method can be overridden to free resources.Note that objects that override
finalizeare significantly more expensive than objects that don't. Finalizers may be run a long time after the object is no longer reachable, depending on memory pressure, so it's a bad idea to rely on them for cleanup. Note also that finalizers are run on a single VM-wide finalizer thread, so doing blocking work in a finalizer is a bad idea. A finalizer is usually only necessary for a class that has a native peer and needs to call a native method to destroy that peer. Even then, it's better to provide an explicitclosemethod (and implementCloseable), and insist that callers manually dispose of instances. This works well for something like files, but less well for something like aBigIntegerwhere typical calling code would have to deal with lots of temporaries. Unfortunately, code that creates lots of temporaries is the worst kind of code from the point of view of the single finalizer thread.If you must use finalizers, consider at least providing your own
ReferenceQueueand having your own thread process that queue.Unlike constructors, finalizers are not automatically chained. You are responsible for calling
super.finalize()yourself.Uncaught exceptions thrown by finalizers are ignored and do not terminate the finalizer thread. See Effective Java Item 7, "Avoid finalizers" for more.
-