Package org.yamcs.studio.data.vtype
Class ArrayShort
java.lang.Object
org.yamcs.studio.data.vtype.ListShort
org.yamcs.studio.data.vtype.ArrayShort
- All Implemented Interfaces:
Serializable
,CollectionNumber
,CollectionShort
,ListNumber
Wraps a
short[]
into a ListShort
.- See Also:
-
Constructor Summary
ConstructorDescriptionArrayShort
(short... array) A newArrayShort
that wraps around the given array.ArrayShort
(short[] array, boolean readOnly) A newArrayShort
that wraps around the given array. -
Method Summary
Modifier and TypeMethodDescriptionboolean
short
getShort
(int index) Returns the element at the specified position in this list casted to a short.iterator()
Returns an iterator over the elements of the collection.void
setShort
(int index, short 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
-
ArrayShort
public ArrayShort(short... array) A newArrayShort
that wraps around the given array. -
ArrayShort
public ArrayShort(short[] array, boolean readOnly) A newArrayShort
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 interfaceCollectionNumber
- Specified by:
iterator
in interfaceCollectionShort
- Overrides:
iterator
in classListShort
-
size
public int size()Description copied from interface:CollectionNumber
Returns the number of elements in the collection.- Specified by:
size
in interfaceCollectionNumber
-
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 interfaceListNumber
- 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 interfaceListNumber
- Overrides:
setShort
in classListShort
- Parameters:
index
- position of the element to changevalue
- the new value
-
equals
-