Class JreJsArray<T>

java.lang.Object
com.vaadin.client.flow.collection.JsArray<T>
com.vaadin.client.flow.collection.jre.JreJsArray<T>
Type Parameters:
T - item type

@Deprecated public class JreJsArray<T> extends JsArray<T>
Deprecated.
Only to be used for testing
JRE implementation of JsArray, should only be used for testing.
Since:
1.0
Author:
Vaadin Ltd
  • Constructor Details

    • JreJsArray

      @SafeVarargs public JreJsArray(T... values)
      Deprecated.
      Creates a new array with the given values.
      Parameters:
      values - the values of the new array
  • Method Details

    • doGet

      public T doGet(int index)
      Deprecated.
      JRE implementation of the final JsArray.get(int) method.
      Parameters:
      index - the index
      Returns:
      the value at the index
    • doSet

      public void doSet(int index, T value)
      Deprecated.
      JRE implementation of the final JsArray.set(int, Object) method.
      Parameters:
      index - the index to set
      value - the value to set
    • push

      public int push(T... values)
      Deprecated.
      Description copied from class: JsArray
      Adds items to the end of this array.
      Overrides:
      push in class JsArray<T>
      Parameters:
      values - the new values to add
      Returns:
      the new length of the array
    • length

      public int length()
      Deprecated.
      Description copied from class: JsArray
      Gets the current length of this array.
      Overrides:
      length in class JsArray<T>
      Returns:
      the array length
    • doSpliceArray

      public JsArray<T> doSpliceArray(int index, int remove, JsArray<? extends T> add)
      Deprecated.
      JRE implementation of the final JsArray.spliceArray(int, int, JsArray) method.
      Parameters:
      index - the index at which to do the operation
      remove - the number of items to remove
      add - new items to add
      Returns:
      an array of removed items
    • splice

      public JsArray<T> splice(int index, int remove, T... add)
      Deprecated.
      Description copied from class: JsArray
      Removes and adds a number of items at the given index.
      Overrides:
      splice in class JsArray<T>
      Parameters:
      index - the index at which do do the operation
      remove - the number of items to remove
      add - new items to add
      Returns:
      an array of removed items
    • doClear

      public void doClear()
      Deprecated.
      Internal method called to clear the array.
    • asList

      public static <T> List<T> asList(JsArray<T> array)
      Deprecated.
      Gets the values of this array as a list. This method is only exposed to simplify testing.
      Type Parameters:
      T - the array type
      Parameters:
      array - the js array to get the values from
      Returns:
      the values as a list
    • shift

      public T shift()
      Deprecated.
      Description copied from class: JsArray
      Removes and returns the first value from the array.
      Overrides:
      shift in class JsArray<T>
      Returns:
      the first value of the array or null if the array is empty
    • forEach

      public void forEach(JsCollections.ForEachCallback<T> callback)
      Deprecated.
      Description copied from class: JsArray
      Invokes the provided callback for each value in this array.
      Overrides:
      forEach in class JsArray<T>
      Parameters:
      callback - the callback to invoke for each value