Udostępnij za pośrednictwem


CollationElementIterator Class

Definition

The CollationElementIterator class is used as an iterator to walk through each character of an international string.

[Android.Runtime.Register("java/text/CollationElementIterator", DoNotGenerateAcw=true)]
public sealed class CollationElementIterator : Java.Lang.Object
[<Android.Runtime.Register("java/text/CollationElementIterator", DoNotGenerateAcw=true)>]
type CollationElementIterator = class
    inherit Object
Inheritance
CollationElementIterator
Attributes

Remarks

The CollationElementIterator class is used as an iterator to walk through each character of an international string. Use the iterator to return the ordering priority of the positioned character. The ordering priority of a character, which we refer to as a key, defines how a character is collated in the given collation object.

For example, consider the following in Spanish: <blockquote>

"ca" &rarr; the first key is key('c') and second key is key('a').
            "cha" &rarr; the first key is key('ch') and second key is key('a').

</blockquote> And in German, <blockquote>

"\u00e4b" &rarr; the first key is key('a'), the second key is key('e'), and
            the third key is key('b').

</blockquote> The key of a character is an integer composed of primary order(short), secondary order(byte), and tertiary order(byte). Java strictly defines the size and signedness of its primitive data types. Therefore, the static functions primaryOrder, secondaryOrder, and tertiaryOrder return int, short, and short respectively to ensure the correctness of the key value.

Example of the iterator usage, <blockquote>

String testString = "This is a test";
             Collator col = Collator.getInstance();
             if (col instanceof RuleBasedCollator) {
                 RuleBasedCollator ruleBasedCollator = (RuleBasedCollator)col;
                 CollationElementIterator collationElementIterator = ruleBasedCollator.getCollationElementIterator(testString);
                 int primaryOrder = CollationElementIterator.primaryOrder(collationElementIterator.next());
                     :
             }

</blockquote>

CollationElementIterator.next returns the collation order of the next character. A collation order consists of primary order, secondary order and tertiary order. The data type of the collation order is <strong>int</strong>. The first 16 bits of a collation order is its primary order; the next 8 bits is the secondary order and the last 8 bits is the tertiary order.

<b>Note:</b> CollationElementIterator is a part of RuleBasedCollator implementation. It is only usable with RuleBasedCollator instances.

Added in 1.1.

Java documentation for java.text.CollationElementIterator.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Fields

Nullorder

Null order which indicates the end of string is reached by the cursor.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Offset

Returns the character offset in the original text corresponding to the next collation element. -or- Sets the iterator to point to the collation element corresponding to the specified character (the parameter is a CHARACTER offset in the original string, not an offset into its corresponding sequence of collation elements).

PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetMaxExpansion(Int32)

Return the maximum length of any expansion sequences that end with the specified comparison order.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Next()

Get the next collation element in the string.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Previous()

Get the previous collation element in the string.

PrimaryOrder(Int32)

Return the primary component of a collation element.

Reset()

Resets the cursor to the beginning of the string.

SecondaryOrder(Int32)

Return the secondary component of a collation element.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetText(ICharacterIterator)

Set a new string over which to iterate.

SetText(String)

Set a new string over which to iterate.

TertiaryOrder(Int32)

Return the tertiary component of a collation element.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to