Interface NativeAstArray

All Superinterfaces:
AstArray, AstNode, Iterable<Object>, ReadOnlyAstArray, ReadOnlyAstNode

public interface NativeAstArray extends AstArray
Author:
Bruno Salmon
  • Method Details

    • getProvider

    • indexOfNativeElement

      int indexOfNativeElement(Object element)
      Returns the first index of the given element, or -1 if it cannot be found.
    • indexOf

      default int indexOf(Object value)
      Returns the first index of the given value, or -1 if it cannot be found.
      Specified by:
      indexOf in interface ReadOnlyAstArray
    • getNativeElement

      Object getNativeElement(int index)
      Return the ith element of the array.
    • getElement

      default <V> V getElement(int index)
      Return the ith element of the array. Most consuming call.
      Specified by:
      getElement in interface ReadOnlyAstArray
    • getObject

      default ReadOnlyAstObject getObject(int index)
      Return the ith element of the array as a JsonObject. If the type is not an object, this can result in runtime errors.
      Specified by:
      getObject in interface ReadOnlyAstArray
    • getArray

      default ReadOnlyAstArray getArray(int index)
      Return the ith element of the array as a JsonArray. If the type is not an array, this can result in runtime errors.
      Specified by:
      getArray in interface ReadOnlyAstArray
    • getScalar

      default <T> T getScalar(int index)
      Specified by:
      getScalar in interface ReadOnlyAstArray
    • pushNativeElement

      void pushNativeElement(Object element)
      Pushes the given element onto the end of the array. Fluent API (return this).
    • setNativeElement

      void setNativeElement(int index, Object value)
      Set a given index to the given value. Fluent API (return this).
    • push

      default NativeAstArray push(Object element)
      Pushes the given element onto the end of the array. Most consuming call.
      Specified by:
      push in interface AstArray
    • push

      default NativeAstArray push(ReadOnlyAstObject object)
      Set a given index to the given object.
      Specified by:
      push in interface AstArray
    • push

      default NativeAstArray push(ReadOnlyAstArray array)
      Set a given index to the given array.
      Specified by:
      push in interface AstArray
    • pushScalar

      default NativeAstArray pushScalar(Object scalar)
      Set a given index to the given element.
      Specified by:
      pushScalar in interface AstArray
    • set

      default NativeAstArray set(int index, Object value)
      Set a given index to the given value. Most consuming call.
      Specified by:
      set in interface AstArray
    • set

      default NativeAstArray set(int index, ReadOnlyAstObject object)
      Set a given index to the given object.
      Specified by:
      set in interface AstArray
    • set

      default NativeAstArray set(int index, ReadOnlyAstArray array)
      Set a given index to the given array.
      Specified by:
      set in interface AstArray
    • setScalar

      default NativeAstArray setScalar(int index, Object scalar)
      Set a given index to the given scalar.
      Specified by:
      setScalar in interface AstArray