|
Oracle® Globalization Development Kit Java API Reference 10g Release 1(10.1) B10971-01 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--oracle.i18n.text.OraCollator
OraCollator class performs locale-sensitive String comparisons, including linguistic collation and binary sorting.
| Field Summary | |
static int |
CANONICAL_COMPOSITIONOraCollator composition level value. |
static int |
EQUALThe result of comparison that OraCollator returns if the two Strings are equal. |
static int |
GREATERThe result of comparison that OraCollator returns if the first String is greater than the second String. |
static int |
LESSThe result of comparison that OraCollator returns if the first String is less than the second String. |
static int |
NO_COMPOSITIONOraCollator composition level value. |
static int |
PRIMARYOraCollator strength value. |
static int |
SECONDARYOraCollator strength value. |
static int |
TERTIARYOraCollator strength value. |
| Constructor Summary | |
protected |
OraCollator()The constructor is here only for completeness. |
| Method Summary | |
Object |
clone()Make an independent duplicate of the OraCollator object. |
int |
compare(Object source, Object target)Compare two Objects using the current collation rule. |
int |
compare(String source, String target)Compare two Strings using the current collation rule. |
boolean |
equals(Object obj)Returns true if this OraCollator object equals to another |
String |
getCharSet()Get the charSet name of this OraCollator |
oracle.i18n.text.OraCollationKey |
getCollationKey(String source)Get OraCollationKey for a given source String. |
int |
getComposition()Get the composition level used for comparison, and make a getColaltionKey call or Compare call. |
static oracle.i18n.text.OraCollator |
getInstance()Constructs an Oracle collation object from the default locale, converts default locale to OraLocaleInfo using the default sorting rule. |
static oracle.i18n.text.OraCollator |
getInstance(Locale locale)Constructs an Oracle collation object from Java's locale. |
static oracle.i18n.text.OraCollator |
getInstance(Locale locale, String sortRule, String charSet)Constructs an OraCollator instance from the specified sortRule and locale. |
static oracle.i18n.text.OraCollator |
getInstance(oracle.i18n.util.OraLocaleInfo oraLocale)Constructs an Oracle collation object from an OraLocaleInfo, retrieves the default collator from the OraLocaleInfo object |
static oracle.i18n.text.OraCollator |
getInstance(String sortRule)Constructs an OraCollator instance from the specified sortRule. |
static oracle.i18n.text.OraCollator |
getInstance(String sortRule, String charSet)Constructs an OraCollator instance from the specified sortRule. |
String |
getName()Get the sorting rule name of this OraCollator |
int |
getStrength()Get the strength is used in comparisons, and make a getColaltionKey call or Compare call. |
int |
hashCode()Create a hashCode for this OraCollator based on sort rule, strength, decomposition level |
void |
setComposition(int compositionMode)Set the composition level used for comparison, and make a getColaltionKey call or Compare call. |
void |
setStrength(int newStrength)Set the strength is used in comparisons, and make a getColaltionKey call or Compare call. |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int PRIMARY
OraCollator strength value. When set, only PRIMARY differences are considered significant during comparison. The assignment of strengths to language features is locale dependant. A common example is for different base letters ("a" vs. "b") to be considered a PRIMARY difference. For monolingual and binary sort, PRIMARY set means accent insensitive.
setStrength(int), getStrength(), Constant Field Valuespublic static final int SECONDARY
OraCollator strength value. When set, only SECONDARY and higher-order differences are considered significant during comparison. The assignment of strengths to language features is locale dependant. A common example is for different accented forms of the same base letter ("a" vs. "â") to be considered a SECONDARY difference. For monolingual and binary sort, SECONDARY set means case insensitive .
setStrength(int), getStrength(), Constant Field Valuespublic static final int TERTIARY
OraCollator strength value. When set, only TERTIARY and higher-order differences are considered significant during comparison. The assignment of strengths to language features is locale dependant. A common example is for case differences ("a" vs. "A") to be considered a TERTIARY difference.
setStrength(int), getStrength(), Constant Field Valuespublic static final int NO_COMPOSITION
OraCollator composition level value. When NO_COMPOSITION is set, canonical equivalence is not considered.
setComposition(int), getComposition(), Constant Field Valuespublic static final int CANONICAL_COMPOSITION
OraCollator composition level value. When CANONICAL_COMPOSITION is set, canonical equivalence is considered as same.
setComposition(int), getComposition(), Constant Field Valuespublic static final int EQUAL
OraCollator returns if the two Strings are equal.
public static final int LESS
OraCollator returns if the first String is less than the second String.
public static final int GREATER
OraCollator returns if the first String is greater than the second String.
| Constructor Detail |
protected OraCollator()
OraCollator objects.| Method Detail |
public static oracle.i18n.text.OraCollator getInstance()
OraLocaleInfo using the default sorting rule.OraCollator instancepublic static oracle.i18n.text.OraCollator getInstance(Locale locale)
OraCollator.locale - java Locale objectOraCollator instancepublic static oracle.i18n.text.OraCollator getInstance(oracle.i18n.util.OraLocaleInfo oraLocale)
OraLocaleInfo, retrieves the default collator from the OraLocaleInfo objectoraLocale - OraLocaleInfo objectOraCollator instancepublic static oracle.i18n.text.OraCollator getInstance(String sortRule)
OraCollator instance from the specified sortRule. The sortRule is the same as NLSRTL's NLS_SORT names; e.g., xgerman, GENERIC_M, unicode_binary, binary, etc. ai or ci can be attached to sort rules to specify the comparison level.sortRule - oracle sort rule nameOraCollator instancepublic static oracle.i18n.text.OraCollator getInstance(String sortRule, String charSet)
OraCollator instance from the specified sortRule. This method will take both Oracle sorting rule and "binary" as sortRule. If using Oracle sorting rule, the charSet values will be ignored. If using binary sorting rule, charSet could be specified by the charSet on the database server. Strings from ai or ci can be attached to "binary" for specifying the comparison level.sortRule - Oracle sort rule namecharSet - Oracle database character set, could be NULL. Default: UTF16OraCollator instancepublic static oracle.i18n.text.OraCollator getInstance(Locale locale, String sortRule, String charSet)
OraCollator instance from the specified sortRule and locale. This method will take both Oracle sorting rule and "binary" as sortRule. If using Oracle sorting rule, the charSet values will be ignored. If using binary sorting rule, charSet could be specified by the charSet on the database server. Strings from ai or ci can be attached to "binary" for specifying the comparison level; it will also record the locale information in the instance.locale - java Locale objectsortRule - Oracle sort rule namecharSet - Oracle database character set, could be NULL. Default: UTF16OraCollator instancepublic String getName()
OraCollatorpublic String getCharSet()
charSet name of this OraCollatorpublic void setStrength(int newStrength)
getColaltionKey call or Compare call. Strength could have the values of PRIMARY, SECONDARY or TERTIARY.newStrength - the new strength to be set; PRIMARY, SECONDARY or TERTIARYPRIMARY, SECONDARY, TERTIARYpublic int getStrength()
getColaltionKey call or Compare call. Strength could have the values of PRIMARY, SECONDARY or TERTIARY.PRIMARY, SECONDARY or TERTIARYPRIMARY, SECONDARY, TERTIARYpublic void setComposition(int compositionMode)
getColaltionKey call or Compare call. Composition level could be CANONICAL_COMPOSITION or NO_COMPOSITION.NO_COMPOSITION, CANONICAL_COMPOSITIONpublic int getComposition()
getColaltionKey call or Compare call. Composition level could be CANONICAL_COMPOSITION or NO_COMPOSITION.CANONICAL_COMPOSITION or NO_COMPOSITIONNO_COMPOSITION, CANONICAL_COMPOSITIONpublic Object clone()
OraCollator object.clone in class ObjectOraCollator objectpublic int hashCode()
OraCollator based on sort rule, strength, decomposition levelhashCode in class Objectpublic boolean equals(Object obj)
OraCollator object equals to anotherequals in interface Comparatorequals in class Objectobj - a target object to be compared withpublic int compare(Object source, Object target)
Objects using the current collation rule. The comparison result will depend on the sorting rule and the setting of comparison level.
This implementation merely returns compare((String)o1, (String)o2).
compare in interface Comparatorsource - first Object to be comparedtarget - second Object to be comparedOraCollator.GREATER, OraCollator.EQUAL, OraCollator.LESSClassCastException - if arguments cannot be cast to Strings.public int compare(String source, String target)
Strings using the current collation rule. The comparison result will depend on the sorting rule and the setting of comparison level.source - first String to be comparedtarget - second String to be comparedOraCollator.GREATER, OraCollator.EQUAL, OraCollator.LESSpublic oracle.i18n.text.OraCollationKey getCollationKey(String source)
OraCollationKey for a given source String.source - source String to get oracle collation keyOraCollationKey object
|
Oracle® Globalization Development Kit Java API Reference 10g Release 1(10.1) B10971-01 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||