Package playn.core

Interface Json.TypedArray<T>

All Superinterfaces:
Iterable<T>
Enclosing interface:
Json

public static interface Json.TypedArray<T> extends Iterable<T>
A JSON array that assumes all values are of a uniform JSON type.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Contains utility methods for creating typed arrays to supply as the default when fetching optional typed arrays from your JSON model.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(int index)
    Returns the value at the given index, or the default value for T if there's a value of a different type at the index.
    get(int index, T dflt)
    Returns the value at the given index, or the specified default value if there's a value of a different type at the index.
    Returns an iterator over the values of the assumed type in this array.
    int
    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

      T get(int index)
      Returns the value at the given index, or the default value for T if there's a value of a different type at the index.
      Throws:
      ArrayIndexOutOfBoundsException - if index < 0 or index >= length
    • get

      T get(int index, T dflt)
      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 - if index < 0 or index >= length
    • iterator

      Iterator<T> 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 by next.
      Specified by:
      iterator in interface Iterable<T>