Package playn.core
Interface Json.TypedArray<T>
- All Superinterfaces:
Iterable<T>
- Enclosing interface:
Json
A JSON array that assumes all values are of a uniform JSON type.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classContains utility methods for creating typed arrays to supply as the default when fetching optional typed arrays from your JSON model. -
Method Summary
Modifier and TypeMethodDescriptionget(int index) Returns the value at the given index, or the default value forTif there's a value of a different type at the index.Returns the value at the given index, or the specified default value if there's a value of a different type at the index.iterator()Returns an iterator over the values of the assumed type in this array.intlength()Returns the number of values in this array.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
length
int length()Returns the number of values in this array. -
get
Returns the value at the given index, or the default value forTif there's a value of a different type at the index.- Throws:
ArrayIndexOutOfBoundsException- ifindex < 0orindex >= length
-
get
Returns the value at the given index, or the specified default value if there's a value of a different type at the index.- Throws:
ArrayIndexOutOfBoundsException- ifindex < 0orindex >= length
-
iterator
Returns an iterator over the values of the assumed type in this array. If a value at a given index isn't of the assumed type, the default value for the assumed type will be returned bynext.
-