Package org.yamcs.studio.data.vtype
Class ArrayByte
java.lang.Object
org.yamcs.studio.data.vtype.ListByte
org.yamcs.studio.data.vtype.ArrayByte
- All Implemented Interfaces:
Serializable
,CollectionByte
,CollectionNumber
,ListNumber
Wraps a
byte[]
into a ListByte
.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
byte
getByte
(int index) Returns the element at the specified position in this list casted to a byte.iterator()
Returns an iterator over the elements of the collection.void
setByte
(int index, byte value) Changes the element at the specified position, casting to the internal representation.int
size()
Returns the number of elements in the collection.
-
Constructor Details
-
ArrayByte
public ArrayByte(byte... array) A new read-onlyArrayByte
that wraps around the given array.- Parameters:
array
- an array
-
ArrayByte
public ArrayByte(byte[] array, boolean readOnly) A newArrayByte
that wraps around the given array.- Parameters:
array
- an arrayreadOnly
- if false the wrapper allows writes to the array
-
-
Method Details
-
iterator
Description copied from interface:CollectionNumber
Returns an iterator over the elements of the collection.- Specified by:
iterator
in interfaceCollectionByte
- Specified by:
iterator
in interfaceCollectionNumber
- Overrides:
iterator
in classListByte
-
size
public int size()Description copied from interface:CollectionNumber
Returns the number of elements in the collection.- Specified by:
size
in interfaceCollectionNumber
-
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 interfaceListNumber
- 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 interfaceListNumber
- Overrides:
setByte
in classListByte
- Parameters:
index
- position of the element to changevalue
- the new value
-
equals
-