Class ArrayInt

java.lang.Object
org.yamcs.studio.data.vtype.ListInt
org.yamcs.studio.data.vtype.ArrayInt
All Implemented Interfaces:
Serializable, CollectionInt, CollectionNumber, ListNumber

public final class ArrayInt extends ListInt implements Serializable
Wraps a int[] into a ListInt.
See Also:
  • Constructor Details

    • ArrayInt

      public ArrayInt(int... array)
      A new ArrayInt that wraps around the given array.
      Parameters:
      array - an array
    • ArrayInt

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

    • iterator

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

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

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

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

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