Package snap.util

Class JSArray


public class JSArray extends JSValue
This JSValue subclass represents an array.
  • Constructor Details

    • JSArray

      public JSArray()
      Constructor.
    • JSArray

      public JSArray(Object anArray)
      Constructor.
  • Method Details

    • getValues

      public List<JSValue> getValues()
      Returns the values.
    • getValueCount

      public int getValueCount()
      Returns the number of values.
    • getValue

      public JSValue getValue(int anIndex)
      Returns a value at given index.
    • addValue

      public void addValue(JSValue aValue)
      Add a value for key.
    • addValue

      public void addValue(JSValue aValue, int anIndex)
      Add a value for key.
    • addNativeValue

      public void addNativeValue(Object aValue)
      Add a native value.
    • getNative

      public List<?> getNative()
      Returns this JS object as a native object.
      Overrides:
      getNative in class JSValue
    • getValueAsString

      public String getValueAsString()
      Returns the value as String if type is String.
      Overrides:
      getValueAsString in class JSValue