CollationElementIterator.Offset Property

Definition

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).

public int Offset { [Android.Runtime.Register("getOffset", "()I", "")] get; [Android.Runtime.Register("setOffset", "(I)V", "")] set; }
[<get: Android.Runtime.Register("getOffset", "()I", "")>]
[<set: Android.Runtime.Register("setOffset", "(I)V", "")>]
member this.Offset : int with get, set

Property Value

The character offset in the original text corresponding to the collation element that will be returned by the next call to next().

Attributes

Remarks

Property getter documentation:

Returns the character offset in the original text corresponding to the next collation element. (That is, getOffset() returns the position in the text corresponding to the collation element that will be returned by the next call to next().) This value will always be the index of the FIRST character corresponding to the collation element (a contracting character sequence is when two or more characters all correspond to the same collation element). This means if you do setOffset(x) followed immediately by getOffset(), getOffset() won't necessarily return x.

Added in 1.2.

Java documentation for java.text.CollationElementIterator.getOffset().

Property setter documentation:

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). The value returned by the next call to next() will be the collation element corresponding to the specified position in the text. If that position is in the middle of a contracting character sequence, the result of the next call to next() is the collation element for that sequence. This means that getOffset() is not guaranteed to return the same value as was passed to a preceding call to setOffset().

Added in 1.2.

Java documentation for java.text.CollationElementIterator.setOffset(int).

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.

Applies to