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