Sdílet prostřednictvím


CollationElementIterator.Previous Method

Definition

Get the previous collation element in the string.

[Android.Runtime.Register("previous", "()I", "")]
public int Previous ();
[<Android.Runtime.Register("previous", "()I", "")>]
member this.Previous : unit -> int

Returns

the previous collation element

Attributes

Remarks

Get the previous collation element in the string.

This iterator iterates over a sequence of collation elements that were built from the string. Because there isn't necessarily a one-to-one mapping from characters to collation elements, this doesn't mean the same thing as "return the collation element [or ordering priority] of the previous character in the string".

This function updates the iterator's internal pointer to point to the collation element preceding the one it's currently pointing to and then returns that element, while next() returns the current element and then updates the pointer. This means that when you change direction while iterating (i.e., call next() and then call previous(), or call previous() and then call next()), you'll get back the same element twice.

Added in 1.2.

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

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