PathIterator
open class PathIterator : MutableIterator<PathIterator.Segment!>
| kotlin.Any | |
| ↳ | android.graphics.PathIterator |
PathIterator can be used to query a given Path object, to discover its operations and point values.
Summary
| Nested classes | |
|---|---|
| open |
This class holds the data for a given segment in a path, as returned by |
| Constants | |
|---|---|
| static Int | |
| static Int | |
| static Int | |
| static Int | |
| static Int | |
| static Int | |
| static Int | |
| Public methods | |
|---|---|
| open Boolean |
hasNext()Returns true if the there are more elements in this iterator to be returned. |
| open PathIterator.Segment |
next()Returns the next |
| open Int |
next(points: FloatArray, offset: Int)Returns the next verb in this iterator's |
| open Int |
peek()Returns the next verb in the iteration, or |
Constants
Public methods
hasNext
open fun hasNext(): Boolean
Returns true if the there are more elements in this iterator to be returned. A return value of false means there are no more elements, and an ensuing call to next() or next(float[],int) )} will return VERB_DONE.
| Return | |
|---|---|
Boolean |
true if there are more elements to be iterated through, false otherwise |
| Exceptions | |
|---|---|
java.util.ConcurrentModificationException |
if the underlying path was modified since this iterator was created. |
next
open fun next(): PathIterator.Segment
Returns the next Segment element in this iterator. There are two versions of next(). This version is slightly more expensive at runtime, since it allocates a new Segment object with every call. The other version, next(float[],int) requires no such allocation, but requires a little more manual effort to use.
| Return | |
|---|---|
PathIterator.Segment |
the next segment in this iterator. This value cannot be null. |
| Exceptions | |
|---|---|
java.util.NoSuchElementException |
if the iteration has no more elements |
java.util.ConcurrentModificationException |
if the underlying path was modified since this iterator was created. |
next
open fun next(
points: FloatArray,
offset: Int
): Int
Returns the next verb in this iterator's Path, and fills entries in the points array with the point data (if any) for that operation. Each two floats represent the data for a single point of that operation. The number of pairs of floats supplied in the resulting array depends on the verb:
VERB_MOVE: 1 pair (indices 0 to 1)VERB_LINE: 2 pairs (indices 0 to 3)VERB_QUAD: 3 pairs (indices 0 to 5)VERB_CONIC: 3.5 pairs (indices 0 to 6), the seventh entry has the conic weightVERB_CUBIC: 4 pairs (indices 0 to 7)VERB_CLOSE: 0 pairsVERB_DONE: 0 pairs
| Parameters | |
|---|---|
points |
FloatArray: The point data for this operation, must have at least 8 items available to hold up to 4 pairs of point values. This value cannot be null. |
offset |
Int: An offset into the points array where entries should be placed. |
| Return | |
|---|---|
Int |
the operation for the next element in the iteration. This value cannot be null. Value is one of the following: |
| Exceptions | |
|---|---|
java.lang.ArrayIndexOutOfBoundsException |
if the points array is too small |
java.util.ConcurrentModificationException |
if the underlying path was modified since this iterator was created. |
peek
open fun peek(): Int
Returns the next verb in the iteration, or VERB_DONE if there are no more elements.
| Return | |
|---|---|
Int |
the next verb in the iteration, or VERB_DONE if there are no more elements. This value cannot be null. Value is one of the following: |
| Exceptions | |
|---|---|
java.util.ConcurrentModificationException |
if the underlying path was modified since this iterator was created. |