PathIterator
open class PathIterator : MutableIterator<PathIterator.Segment!>
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 next() .
|
Public methods |
open Boolean |
Returns true if the there are more elements in this iterator to be returned.
|
open PathIterator.Segment |
Returns the next Segment element in this iterator.
|
open 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.
|
open Int |
Returns the next verb in the iteration, or VERB_DONE if there are no more elements.
|
Constants
VERB_CLOSE
static val VERB_CLOSE: Int
Value: 5
VERB_CONIC
static val VERB_CONIC: Int
Value: 3
VERB_CUBIC
static val VERB_CUBIC: Int
Value: 4
VERB_DONE
static val VERB_DONE: Int
Value: 6
VERB_LINE
static val VERB_LINE: Int
Value: 1
VERB_MOVE
static val VERB_MOVE: Int
Value: 0
VERB_QUAD
static val VERB_QUAD: Int
Value: 2
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.
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:
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. |
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.
Exceptions |
java.util.ConcurrentModificationException |
if the underlying path was modified since this iterator was created. |