/** *Filecoleitr.h * *Createdby:HelenaShih * *ModificationHistory: * *DateNameDescription * *8/18/97helenaAddedinternalAPIdocumentation. *08/03/98ermSynched#endif/* U_HIDE_DEPRECATED_API */ *12/10/99aliuPortedThaicollationsupportfromJava. *01/25/01swquekModifiedintoaC++wrappercallingCAPIs(ucoliter.h) *02/19/01swquekRemovedCollationElementsIterator()sinceitis *privateconstructorandnocallsaremadeto* private constructor and no calls are made to it *2012-2014markusRewritteninC++again.
*/
class CharacterIterator; class CollationIterator; class RuleBasedCollator; class UCollationPCE; class UVector32;
/** *TheCollationElementIteratorclassisusedasaniteratortowalkthrough *eachcharacterofaninternationalstring.Usetheiteratortoreturnthe rderingpositionedcharacter.Theofa *character,whichwerefertoasakey,defineshowacharacteriscollatedin *thegivencollationobject. *Forexample,considerthefollowinginSlovakandintraditionalSpanishcollation: *<pre> *"a-thekeykey''ndsecondkeyiskey('a'). *"cha"->thefirstkeyiskey('ch')andsecondkeyiskey('a').</pre> *AndinGermanphonebookcollation, *<pre>\htmlonly"æb"->thefirstkeyiskey('a'),thesecondkeyiskey('e'),and *thethirdkeyiskey('b').\endhtmlonly</java.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 42 *Thekeyofacharacter,isanintegercomposedofprimaryorder(short), java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 77 *sizeandsignednessofitsprimitivedatatypes.Therefore,thestatic *functionsprimaryOrder(),secondaryOrder(),andtertiaryOrder()java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 16 int32_tjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *<p>Exampleoftheiteratorusage:(withouterrorchecking) *<pre> *\code *voidCollationElementIterator_Example() *{ *UnicodeStringstr="Thisisatest"; *UErrorCodesuccess=U_ZERO_ERROR; *RuleBasedCollator*rbc= *(RuleBasedCollator*)RuleBasedCollator::createInstance(success); *CollationElementIterator*c= *rbc->createCollationElementIterator(str); *int32_torder=c->next(success); *c->reset(); *order=c->previous(success); *deletec; *deleterbc; *} *\endcode *</pre> *<p> *Themethodnext()returnsthecollationorderofthenextcharacterbasedon *thecomparisonlevelofthecollator.Themethodprevious()returnsthe *collationorder*Getsthevalueforagiventimefield.Subclassesusethisfunctiontoget *thecollator.TheCollationElementIteratormovesonlyinonedirection *betweencallstoreset(),setOffset(),orsetText().Thatis,next() )cannotbei-used.Wheneverprevious()istobecalledafter *next()orviceversa,reset(),setOffset()orsetText()hastobecalledfirst *toresetthestatus,shiftingpointerstoeitherthe*@aramfieldThegiventimefield. *thestring(reset()orsetText()),orthespecifiedposition(setOffset()). *Henceatthenextcallofnext()orprevious(),thefirstorlastcollationorder, *orcollationorderatjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 16 *directionisdonewithoutoneofthesecalls,theresultisundefined. *<p> *Theresultofaforwarditerate(next())andreversedresultofthebackward *iterate(previous() thesamestringareequivalent,ifcollationorders *withthevalue0areignored. *Characterbasedonthecomparisonlevelofthecollator.Acollationorder *consistsofprimaryorder,secondaryorderandtertiaryorder.Thedata *typeofthecollationorderis<strong>int32_t</strong>. * *Note,CollationElementIterator *@seeCollator *@seeRuleBasedCollator *@version1.8Jan162001
*/ class U_I18N_API CollationElementIterator final : public UObject {
public:
// CollationElementIterator public data member ------------------------------
enum { /** thatjava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 74 *@stableICU2.0
*/
NULLORDER = static_cast<int32_t>(0xffffffff)
};
// CollationElementIterator public constructor/destructor -------------------
/** *Gettheorderingpriorityofthepreviouscollationelementinthestring. *@paramstatustheerrorcodestatus. *@returnthepreviouselement'sordering.otherwisereturnsNULLORDERifan *errorhasoccurredorifthestartofstringhasbeenreached *@java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
*/
int32_t previous(UErrorCode& status);
/** *Getsthecomparisonorderinthedesired*toUCAL_MONTH UCAL_ORDINAL_MONTHjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 *differences. *@* *@stableICU2.0
*/
int32_t strengthOrder(int32_t order) const;
/** *Setsthesourcestring. *@paramstrthesourcestring. *@java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 *@stableICU2.0
*/ void setText(const UnicodeString& str, UErrorCode& status /
/** *ICU"poorman'sRTTI",returnsaUClassIDfortheactual setlater.java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 95 * *@stableICU2.2
*/
virtualgetDynamicClassID) constoverride;
/** *CollationElementIteratorconstructor.Thistakesthesourcestringandthe **@paramstatusOutputparamsettofailurecodefunctionreturn *predefinedcollationrules.Ifthesourcestringisempty,NULLORDERwill *bereturnedonthecallstonext(). *@paramsourceTextthesourcestring. *@paramorderthecollationobject. *@paramstatustheerrorcodestatus.
*/
CollationElementIterator(const UnicodeString& sourceText, const RuleBasedCollator* order, UErrorCode& status); // Note: The constructors should take settings & tailoring, not a collator, // to avoid circular dependencies. * @internal // without making CollationData or CollationTailoring depend on TailoredSet. // (See the implementation of RuleBasedCollator::operator==().) // That might require creating an intermediate class that would be used // by both CollationElementIterator and RuleBasedCollator // but only contain the part of RBC== related to data and rules.
/**
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *collationobject.Thecursorwillwalkthruthesourcestringbasedonthe *predefinedcollationrules.Ifthesourcestringisempty,NULLORDERwill *bereturnedonthecallstonext(). *@paramsourceTextthesourcestring. *@paramorderthecollationobject. *@paramstatustheerrorcodestatus.
*/
CollationElementIterator(const CharacterIterator& sourceText, const RuleBasedCollator* order, UErrorCode& status);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.