Package org.epics.util.array
Class ArrayInteger
- java.lang.Object
-
- org.epics.util.array.ListInteger
-
- org.epics.util.array.ArrayInteger
-
- All Implemented Interfaces:
Serializable,CollectionInteger,CollectionNumber,ListNumber
public final class ArrayInteger extends ListInteger implements Serializable
Non-resizableListIntegerimplementation backed by aint[].- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ArrayInteger(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)intgetInt(int index)Returns the element at the specified position in this list casted to an int.IteratorIntegeriterator()Returns an iterator over the elements of the collection.static ArrayIntegerof(int... values)Returns an unmodifiableArrayIntegerwrapper for the givenintarray.voidsetAll(int index, ListNumber list)Changes the elements starting at the specified position, taking them based on the internal representation.voidsetInt(int index, int value)Changes the element at the specified position, casting to the internal representation.intsize()Returns the number of elements in the collection.ArrayIntegersubList(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.ListInteger
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
-
ArrayInteger
public ArrayInteger(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 IteratorInteger iterator()
Description copied from interface:CollectionNumberReturns an iterator over the elements of the collection.- Specified by:
iteratorin interfaceCollectionInteger- Specified by:
iteratorin interfaceCollectionNumber- Overrides:
iteratorin classListInteger- 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
-
getInt
public int getInt(int index)
Description copied from interface:ListNumberReturns the element at the specified position in this list casted to an int.- Specified by:
getIntin 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:ListNumberChanges the element at the specified position, casting to the internal representation.- Specified by:
setIntin interfaceListNumber- Overrides:
setIntin classListInteger- Parameters:
index- position of the element to changevalue- the new value
-
subList
public ArrayInteger 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 classListInteger- 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 classListInteger- Parameters:
index- position of the first element to changelist- the new values
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classListInteger
-
of
public static ArrayInteger of(int... values)
Returns an unmodifiableArrayIntegerwrapper for the givenintarray.- Parameters:
values- a primitive array.- Returns:
- an immutable wrapper.
-
-