Package org.epics.util.array
Interface ListNumber
-
- All Superinterfaces:
CollectionNumber
- All Known Implementing Classes:
ArrayByte
,ArrayDouble
,ArrayFloat
,ArrayInteger
,ArrayLong
,ArrayShort
,ArrayUByte
,ArrayUInteger
,ArrayULong
,ArrayUShort
,BufferInteger
,CircularBufferDouble
,ListByte
,ListDouble
,ListFloat
,ListInteger
,ListLong
,ListShort
,ListUByte
,ListUInteger
,ListULong
,ListUShort
,SortedListView
public interface ListNumber extends CollectionNumber
An ordered collection of numeric (primitive) elements. This class allows to implement a single binding for a list of primitive values of six different binding. If the original type is required, instanceof can be used to differentiate betweenListDouble
,ListFloat
,ListLong
,ListInteger
,ListShort
andListByte
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte
getByte(int index)
Returns the element at the specified position in this list casted to a byte.double
getDouble(int index)
Returns the element at the specified position in this list casted to a double.float
getFloat(int index)
Returns the element at the specified position in this list casted to a float.int
getInt(int index)
Returns the element at the specified position in this list casted to an int.long
getLong(int index)
Returns the element at the specified position in this list casted to a long.short
getShort(int index)
Returns the element at the specified position in this list casted to a short.void
setAll(int index, ListNumber list)
Changes the elements starting at the specified position, taking them based on the internal representation.void
setByte(int index, byte value)
Changes the element at the specified position, casting to the internal representation.void
setDouble(int index, double value)
Changes the element at the specified position, casting to the internal representation.void
setFloat(int index, float value)
Changes the element at the specified position, casting to the internal representation.void
setInt(int index, int value)
Changes the element at the specified position, casting to the internal representation.void
setLong(int index, long value)
Changes the element at the specified position, casting to the internal representation.void
setShort(int index, short value)
Changes the element at the specified position, casting to the internal representation.ListNumber
subList(int fromIndex, int toIndex)
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.-
Methods inherited from interface org.epics.util.array.CollectionNumber
iterator, size, toArray
-
-
-
-
Method Detail
-
getDouble
double getDouble(int index)
Returns the element at the specified position in this list casted to a double.- Parameters:
index
- position of the element to return- Returns:
- the element at the specified position in this list
- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)
-
getFloat
float getFloat(int index)
Returns the element at the specified position in this list casted to a float.- Parameters:
index
- position of the element to return- Returns:
- the element at the specified position in this list
- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)
-
getLong
long getLong(int index)
Returns the element at the specified position in this list casted to a long.- Parameters:
index
- position of the element to return- Returns:
- the element at the specified position in this list
- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)
-
getInt
int getInt(int index)
Returns the element at the specified position in this list casted to an int.- Parameters:
index
- position of the element to return- Returns:
- the element at the specified position in this list
- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)
-
getShort
short getShort(int index)
Returns the element at the specified position in this list casted to a short.- Parameters:
index
- position of the element to return- Returns:
- the element at the specified position in this list
- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)
-
getByte
byte getByte(int index)
Returns the element at the specified position in this list casted to a byte.- Parameters:
index
- position of the element to return- Returns:
- the element at the specified position in this list
- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)
-
setDouble
void setDouble(int index, double value)
Changes the element at the specified position, casting to the internal representation.- Parameters:
index
- position of the element to changevalue
- the new value- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)
-
setFloat
void setFloat(int index, float value)
Changes the element at the specified position, casting to the internal representation.- Parameters:
index
- position of the element to changevalue
- the new value- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)
-
setLong
void setLong(int index, long value)
Changes the element at the specified position, casting to the internal representation.- Parameters:
index
- position of the element to changevalue
- the new value- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)
-
setInt
void setInt(int index, int value)
Changes the element at the specified position, casting to the internal representation.- Parameters:
index
- position of the element to changevalue
- the new value- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)
-
setShort
void setShort(int index, short value)
Changes the element at the specified position, casting to the internal representation.- Parameters:
index
- position of the element to changevalue
- the new value- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)
-
setByte
void setByte(int index, byte value)
Changes the element at the specified position, casting to the internal representation.- Parameters:
index
- position of the element to changevalue
- the new value- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)
-
setAll
void setAll(int index, ListNumber list)
Changes the elements starting at the specified position, taking them based on the internal representation.- Parameters:
index
- position of the first element to changelist
- the new values- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
) or if this list is too short to hold the data.
-
subList
ListNumber subList(int fromIndex, int toIndex)
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.- Parameters:
fromIndex
- low endpoint (inclusive) of the subListtoIndex
- high endpoint (exclusive) of the subList- Returns:
- a view of the specified range within this list
- Throws:
IndexOutOfBoundsException
- for an illegal endpoint index value (fromIndex < 0 || toIndex > size || fromIndex > toIndex
)
-
-