Package org.epics.util.array
Class ArrayDouble
- java.lang.Object
-
- org.epics.util.array.ListDouble
-
- org.epics.util.array.ArrayDouble
-
- All Implemented Interfaces:
Serializable,CollectionDouble,CollectionNumber,ListNumber
public final class ArrayDouble extends ListDouble implements Serializable
Non-resizableListDoubleimplementation backed by adouble[].- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ArrayDouble(CollectionNumber coll)Constructs a list containing the values provided by the specified collection in the order returned by its iterator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)doublegetDouble(int index)Returns the element at the specified position in this list casted to a double.IteratorDoubleiterator()Returns an iterator over the elements of the collection.static ArrayDoubleof(double... values)Returns an unmodifiableArrayDoublewrapper for the givendoublearray.voidsetAll(int index, ListNumber list)Changes the elements starting at the specified position, taking them based on the internal representation.voidsetDouble(int index, double value)Changes the element at the specified position, casting to the internal representation.intsize()Returns the number of elements in the collection.ArrayDoublesubList(int fromIndex, int toIndex)Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.<T> TtoArray(T array)
-
-
-
Constructor Detail
-
ArrayDouble
public ArrayDouble(CollectionNumber coll)
Constructs a list containing the values provided by the specified collection in the order returned by its iterator.- Parameters:
coll- the collection whose values will be placed in this list
-
-
Method Detail
-
iterator
public final IteratorDouble iterator()
Description copied from interface:CollectionNumberReturns an iterator over the elements of the collection.- Specified by:
iteratorin interfaceCollectionDouble- Specified by:
iteratorin interfaceCollectionNumber- Overrides:
iteratorin classListDouble- Returns:
- a new iterator
-
size
public final int size()
Description copied from interface:CollectionNumberReturns the number of elements in the collection.- Specified by:
sizein interfaceCollectionNumber- Returns:
- the number of elements in the collection
-
getDouble
public double getDouble(int index)
Description copied from interface:ListNumberReturns the element at the specified position in this list casted to a double.- Specified by:
getDoublein 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:ListNumberChanges the element at the specified position, casting to the internal representation.- Specified by:
setDoublein interfaceListNumber- Overrides:
setDoublein classListDouble- Parameters:
index- position of the element to changevalue- the new value
-
subList
public ArrayDouble subList(int fromIndex, int toIndex)
Description copied from interface:ListNumberReturns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.- Specified by:
subListin interfaceListNumber- Overrides:
subListin classListDouble- Parameters:
fromIndex- low endpoint (inclusive) of the subListtoIndex- high endpoint (exclusive) of the subList- Returns:
- a view of the specified range within this list
-
setAll
public void setAll(int index, ListNumber list)Description copied from interface:ListNumberChanges the elements starting at the specified position, taking them based on the internal representation.- Specified by:
setAllin interfaceListNumber- Overrides:
setAllin classListDouble- Parameters:
index- position of the first element to changelist- the new values
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classListDouble
-
toArray
public <T> T toArray(T array)
- Specified by:
toArrayin interfaceCollectionNumber- Type Parameters:
T- the type of the array- Parameters:
array- the array into which the elements of this list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.- Returns:
- an array containing the elements
-
of
public static ArrayDouble of(double... values)
Returns an unmodifiableArrayDoublewrapper for the givendoublearray.- Parameters:
values- a primitive array.- Returns:
- an immutable wrapper.
-
-