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