Class ArrayShort

java.lang.Object
org.yamcs.studio.data.vtype.ListShort
org.yamcs.studio.data.vtype.ArrayShort
All Implemented Interfaces:
Serializable, CollectionNumber, CollectionShort, ListNumber

public final class ArrayShort extends ListShort implements Serializable
Wraps a short[] into a ListShort.
See Also:
  • Constructor Details

    • ArrayShort

      public ArrayShort(short... array)
      A new ArrayShort that wraps around the given array.
    • ArrayShort

      public ArrayShort(short[] array, boolean readOnly)
      A new ArrayShort that wraps around the given array.
      Parameters:
      array - an array
      readOnly - if false the wrapper allows writes to the array
  • Method Details

    • iterator

      public IteratorShort iterator()
      Description copied from interface: CollectionNumber
      Returns an iterator over the elements of the collection.
      Specified by:
      iterator in interface CollectionNumber
      Specified by:
      iterator in interface CollectionShort
      Overrides:
      iterator in class ListShort
    • size

      public int size()
      Description copied from interface: CollectionNumber
      Returns the number of elements in the collection.
      Specified by:
      size in interface CollectionNumber
    • getShort

      public short getShort(int index)
      Description copied from interface: ListNumber
      Returns the element at the specified position in this list casted to a short.
      Specified by:
      getShort in interface ListNumber
      Parameters:
      index - position of the element to return
      Returns:
      the element at the specified position in this list
    • setShort

      public void setShort(int index, short value)
      Description copied from interface: ListNumber
      Changes the element at the specified position, casting to the internal representation.
      Specified by:
      setShort in interface ListNumber
      Overrides:
      setShort in class ListShort
      Parameters:
      index - position of the element to change
      value - the new value
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class ListShort