Package org.epics.util.array
Class ArrayUInteger
- java.lang.Object
-
- org.epics.util.array.ListUInteger
-
- org.epics.util.array.ArrayUInteger
-
- All Implemented Interfaces:
Serializable
,CollectionNumber
,CollectionUInteger
,ListNumber
public final class ArrayUInteger extends ListUInteger implements Serializable
Non-resizableListUInteger
implementation backed by aint[]
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ArrayUInteger(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 boolean
equals(Object obj)
int
getInt(int index)
Returns the element at the specified position in this list casted to an int.IteratorUInteger
iterator()
Returns an iterator over the elements of the collection.static ArrayUInteger
of(int... values)
Returns an unmodifiableArrayUInteger
wrapper for the givenint
array.void
setAll(int index, ListNumber list)
Changes the elements starting at the specified position, taking them based on the internal representation.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.ArrayUInteger
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 class org.epics.util.array.ListUInteger
getByte, getDouble, getFloat, getLong, getShort, hashCode, setByte, setDouble, setFloat, setLong, setShort, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.epics.util.array.CollectionNumber
toArray
-
-
-
-
Constructor Detail
-
ArrayUInteger
public ArrayUInteger(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 IteratorUInteger iterator()
Description copied from interface:CollectionNumber
Returns an iterator over the elements of the collection.- Specified by:
iterator
in interfaceCollectionNumber
- Specified by:
iterator
in interfaceCollectionUInteger
- Overrides:
iterator
in classListUInteger
- Returns:
- a new iterator
-
size
public final int size()
Description copied from interface:CollectionNumber
Returns the number of elements in the collection.- Specified by:
size
in interfaceCollectionNumber
- Returns:
- the number of elements in the collection
-
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 classListUInteger
- Parameters:
index
- position of the element to changevalue
- the new value
-
subList
public ArrayUInteger subList(int fromIndex, int toIndex)
Description copied from interface:ListNumber
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.- Specified by:
subList
in interfaceListNumber
- Overrides:
subList
in classListUInteger
- 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:ListNumber
Changes the elements starting at the specified position, taking them based on the internal representation.- Specified by:
setAll
in interfaceListNumber
- Overrides:
setAll
in classListUInteger
- Parameters:
index
- position of the first element to changelist
- the new values
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classListUInteger
-
of
public static ArrayUInteger of(int... values)
Returns an unmodifiableArrayUInteger
wrapper for the givenint
array.- Parameters:
values
- a primitive array.- Returns:
- an immutable wrapper.
-
-