Package org.yamcs.studio.data.vtype
Class ArrayDouble
java.lang.Object
org.yamcs.studio.data.vtype.ListDouble
org.yamcs.studio.data.vtype.ArrayDouble
- All Implemented Interfaces:
Serializable
,CollectionDouble
,CollectionNumber
,ListNumber
Wraps a
double[]
into a ListDouble
.- See Also:
-
Constructor Summary
ConstructorDescriptionArrayDouble
(double... array) A new read-onlyArrayDouble
that wraps around the given array.ArrayDouble
(double[] array, boolean readOnly) A newArrayDouble
that wraps around the given array. -
Method Summary
Modifier and TypeMethodDescriptionboolean
double
getDouble
(int index) Returns the element at the specified position in this list casted to a double.iterator()
Returns an iterator over the elements of the collection.void
setDouble
(int index, double 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
-
ArrayDouble
public ArrayDouble(double... array) A new read-onlyArrayDouble
that wraps around the given array.- Parameters:
array
- an array
-
ArrayDouble
public ArrayDouble(double[] array, boolean readOnly) A newArrayDouble
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 interfaceCollectionDouble
- Specified by:
iterator
in interfaceCollectionNumber
- Overrides:
iterator
in classListDouble
-
size
public int size()Description copied from interface:CollectionNumber
Returns the number of elements in the collection.- Specified by:
size
in interfaceCollectionNumber
-
getDouble
public double getDouble(int index) Description copied from interface:ListNumber
Returns the element at the specified position in this list casted to a double.- Specified by:
getDouble
in interfaceListNumber
- Parameters:
index
- position of the element to return- Returns:
- the element at the specified position in this list
-
setDouble
public void setDouble(int index, double value) Description copied from interface:ListNumber
Changes the element at the specified position, casting to the internal representation.- Specified by:
setDouble
in interfaceListNumber
- Overrides:
setDouble
in classListDouble
- Parameters:
index
- position of the element to changevalue
- the new value
-
equals
- Overrides:
equals
in classListDouble
-