Since: 5.5

class IntlPartsIterator extends IntlIterator implements Iterator (View source)

Objects of this class can be obtained from IntlBreakIterator objects. While the break iterators provide a sequence of boundary positions when iterated, IntlPartsIterator objects provide, as a convenience, the text fragments comprehended between two successive boundaries.

The keys may represent the offset of the left boundary, right boundary, or they may just the sequence of non-negative integers. See IntlBreakIterator::getPartsIterator.

Constants

KEY_SEQUENTIAL

KEY_LEFT

KEY_RIGHT

Methods

mixed
current()

Get the current element

mixed
key()

Get the current key

void
next()

Move forward to the next element

void
rewind()

Rewind the iterator to the first element

bool
valid()

Check if current position is valid

getBreakIterator()

Get IntlBreakIterator backing this parts iterator

int
getRuleStatus()

No description

Details

mixed current()

Get the current element

Return Value

mixed

Can return any type.

mixed key()

Get the current key

Return Value

mixed

TKey on success, or null on failure.

void next()

Move forward to the next element

Return Value

void

Any returned value is ignored.

void rewind()

Rewind the iterator to the first element

Return Value

void

Any returned value is ignored.

bool valid()

Check if current position is valid

Return Value

bool

The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.

IntlBreakIterator getBreakIterator()

Get IntlBreakIterator backing this parts iterator

Return Value

IntlBreakIterator

int getRuleStatus()

Since: 8.1

No description

Return Value

int