Class ArrayByte

java.lang.Object
org.yamcs.studio.data.vtype.ListByte
org.yamcs.studio.data.vtype.ArrayByte
All Implemented Interfaces:
Serializable, CollectionByte, CollectionNumber, ListNumber

public final class ArrayByte extends ListByte implements Serializable
Wraps a byte[] into a ListByte.
See Also:
  • Constructor Details

    • ArrayByte

      public ArrayByte(byte... array)
      A new read-only ArrayByte that wraps around the given array.
      Parameters:
      array - an array
    • ArrayByte

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

    • iterator

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

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

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

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

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