Package org.epics.util.array
Class CollectionNumbers
- java.lang.Object
-
- org.epics.util.array.CollectionNumbers
-
public class CollectionNumbers extends Object
Utilities to work with number collections.- Author:
- carcassi
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidarrayCopy(CollectionNumber src, byte[] dest, int destPos)Copies the content of the collection to an array at the desired position.static voidarrayCopy(CollectionNumber src, double[] dest, int destPos)Copies the content of the collection to an array at the desired position.static voidarrayCopy(CollectionNumber src, float[] dest, int destPos)Copies the content of the collection to an array at the desired position.static voidarrayCopy(CollectionNumber src, int[] dest, int destPos)Copies the content of the collection to an array at the desired position.static voidarrayCopy(CollectionNumber src, long[] dest, int destPos)Copies the content of the collection to an array at the desired position.static voidarrayCopy(CollectionNumber src, short[] dest, int destPos)Copies the content of the collection to an array at the desired position.static ListNumbertoList(Object values)Takes a primitive array and wraps it into the appropriate mutable array wrapper.static ArrayBytetoListByte(byte... values)Takes a byte array and wraps it into an ArrayByte.static ArrayDoubletoListDouble(double... values)Takes a double array and wraps it into an ArrayDouble.static ArrayFloattoListFloat(float... values)Takes a float array and wraps it into an ArrayFloat.static ArrayIntegertoListInt(int... values)Takes an int array and wraps it into an ArrayInteger.static ArrayLongtoListLong(long... values)Takes a long array and wraps it into an ArrayLong.static ArrayShorttoListShort(short... values)Takes a short array and wraps it into an ArrayShort.static ArrayUBytetoListUByte(byte... values)Takes an unsigned byte array and wraps it into an ArrayUByte.static ArrayUIntegertoListUInt(int... values)Takes an unsigned int array and wraps it into an ArrayUInteger.static ArrayULongtoListULong(long... values)Takes an unsigned long array and wraps it into an ArrayULong.static ArrayUShorttoListUShort(short... values)Takes an unsigned short array and wraps it into an ArrayUShort.static ArrayByteunmodifiableList(ArrayByte list)Returns an unmodifiable view of the specified list.static ArrayDoubleunmodifiableList(ArrayDouble list)Returns an unmodifiable view of the specified list.static ArrayFloatunmodifiableList(ArrayFloat list)Returns an unmodifiable view of the specified list.static ArrayIntegerunmodifiableList(ArrayInteger list)Returns an unmodifiable view of the specified list.static ArrayLongunmodifiableList(ArrayLong list)Returns an unmodifiable view of the specified list.static ArrayShortunmodifiableList(ArrayShort list)Returns an unmodifiable view of the specified list.static ListByteunmodifiableList(ListByte list)Returns an unmodifiable view of the specified list.static ListDoubleunmodifiableList(ListDouble list)Returns an unmodifiable view of the specified list.static ListFloatunmodifiableList(ListFloat list)Returns an unmodifiable view of the specified list.static ListIntegerunmodifiableList(ListInteger list)Returns an unmodifiable view of the specified list.static ListLongunmodifiableList(ListLong list)Returns an unmodifiable view of the specified list.static ListNumberunmodifiableList(ListNumber list)Returns an unmodifiable view of the specified list.static ListShortunmodifiableList(ListShort list)Returns an unmodifiable view of the specified list.static ArrayByteunmodifiableListByte(byte... values)Returns an unmodifiableArrayBytewrapper for the givenbytearray.static ArrayDoubleunmodifiableListDouble(double... values)Returns an unmodifiableArrayDoublewrapper for the givendoublearray.static ArrayFloatunmodifiableListFloat(float... values)Returns an unmodifiableArrayFloatwrapper for the givenfloatarray.static ArrayIntegerunmodifiableListInt(int... values)Returns an unmodifiableArrayIntegerwrapper for the givenintarray.static ArrayLongunmodifiableListLong(long... values)Returns an unmodifiableArrayLongwrapper for the givenlongarray.static ArrayShortunmodifiableListShort(short... values)Returns an unmodifiableArrayShortwrapper for the givenshortarray.static ArrayUByteunmodifiableListUByte(byte... values)Returns an unmodifiableArrayUBytewrapper for the given unsignedbytearray.static ArrayUIntegerunmodifiableListUInt(int... values)Returns an unmodifiableArrayUIntegerwrapper for the given unsignedintarray.static ArrayULongunmodifiableListULong(long... values)Returns an unmodifiableArrayULongwrapper for the given unsignedlongarray.static ArrayUShortunmodifiableListUShort(short... values)Returns an unmodifiableArrayUShortwrapper for the given unsignedshortarray.
-
-
-
Method Detail
-
toList
public static ListNumber toList(Object values)
Takes a primitive array and wraps it into the appropriate mutable array wrapper.- Parameters:
values- a primitive array (e.g. int[])- Returns:
- a mutable wrapper
- Throws:
IllegalArgumentException- if the given object is not a primitive array.
-
toListDouble
public static ArrayDouble toListDouble(double... values)
Takes a double array and wraps it into an ArrayDouble.- Parameters:
values- a primitive array- Returns:
- a mutable wrapper
- Throws:
IllegalArgumentException- if the given object is not a primitive array.
-
toListFloat
public static ArrayFloat toListFloat(float... values)
Takes a float array and wraps it into an ArrayFloat.- Parameters:
values- a primitive array- Returns:
- a mutable wrapper
- Throws:
IllegalArgumentException- if the given object is not a primitive array.
-
toListLong
public static ArrayLong toListLong(long... values)
Takes a long array and wraps it into an ArrayLong.- Parameters:
values- a primitive array- Returns:
- a mutable wrapper
- Throws:
IllegalArgumentException- if the given object is not a primitive array.
-
toListULong
public static ArrayULong toListULong(long... values)
Takes an unsigned long array and wraps it into an ArrayULong.- Parameters:
values- a primitive array- Returns:
- a mutable wrapper
- Throws:
IllegalArgumentException- if the given object is not a primitive array.
-
toListInt
public static ArrayInteger toListInt(int... values)
Takes an int array and wraps it into an ArrayInteger.- Parameters:
values- a primitive array- Returns:
- a mutable wrapper
- Throws:
IllegalArgumentException- if the given object is not a primitive array.
-
toListUInt
public static ArrayUInteger toListUInt(int... values)
Takes an unsigned int array and wraps it into an ArrayUInteger.- Parameters:
values- a primitive array- Returns:
- a mutable wrapper
- Throws:
IllegalArgumentException- if the given object is not a primitive array.
-
toListShort
public static ArrayShort toListShort(short... values)
Takes a short array and wraps it into an ArrayShort.- Parameters:
values- a primitive array- Returns:
- a mutable wrapper
- Throws:
IllegalArgumentException- if the given object is not a primitive array.
-
toListUShort
public static ArrayUShort toListUShort(short... values)
Takes an unsigned short array and wraps it into an ArrayUShort.- Parameters:
values- a primitive array- Returns:
- a mutable wrapper
- Throws:
IllegalArgumentException- if the given object is not a primitive array.
-
toListByte
public static ArrayByte toListByte(byte... values)
Takes a byte array and wraps it into an ArrayByte.- Parameters:
values- a primitive array- Returns:
- a mutable wrapper
- Throws:
IllegalArgumentException- if the given object is not a primitive array.
-
toListUByte
public static ArrayUByte toListUByte(byte... values)
Takes an unsigned byte array and wraps it into an ArrayUByte.- Parameters:
values- a primitive array- Returns:
- a mutable wrapper
- Throws:
IllegalArgumentException- if the given object is not a primitive array.
-
unmodifiableList
public static ListNumber unmodifiableList(ListNumber list)
Returns an unmodifiable view of the specified list.- Parameters:
list- the list for which an unmodifiable view is to be returned.- Returns:
- an unmodifiable view of the specified list.
-
unmodifiableList
public static ListDouble unmodifiableList(ListDouble list)
Returns an unmodifiable view of the specified list.- Parameters:
list- the list for which an unmodifiable view is to be returned.- Returns:
- an unmodifiable view of the specified list.
-
unmodifiableList
public static ListFloat unmodifiableList(ListFloat list)
Returns an unmodifiable view of the specified list.- Parameters:
list- the list for which an unmodifiable view is to be returned.- Returns:
- an unmodifiable view of the specified list.
-
unmodifiableList
public static ListLong unmodifiableList(ListLong list)
Returns an unmodifiable view of the specified list.- Parameters:
list- the list for which an unmodifiable view is to be returned.- Returns:
- an unmodifiable view of the specified list.
-
unmodifiableList
public static ListInteger unmodifiableList(ListInteger list)
Returns an unmodifiable view of the specified list.- Parameters:
list- the list for which an unmodifiable view is to be returned.- Returns:
- an unmodifiable view of the specified list.
-
unmodifiableList
public static ListShort unmodifiableList(ListShort list)
Returns an unmodifiable view of the specified list.- Parameters:
list- the list for which an unmodifiable view is to be returned.- Returns:
- an unmodifiable view of the specified list.
-
unmodifiableList
public static ListByte unmodifiableList(ListByte list)
Returns an unmodifiable view of the specified list.- Parameters:
list- the list for which an unmodifiable view is to be returned.- Returns:
- an unmodifiable view of the specified list.
-
unmodifiableList
public static ArrayDouble unmodifiableList(ArrayDouble list)
Returns an unmodifiable view of the specified list.- Parameters:
list- the list for which an unmodifiable view is to be returned.- Returns:
- an unmodifiable view of the specified list.
-
unmodifiableList
public static ArrayFloat unmodifiableList(ArrayFloat list)
Returns an unmodifiable view of the specified list.- Parameters:
list- the list for which an unmodifiable view is to be returned.- Returns:
- an unmodifiable view of the specified list.
-
unmodifiableList
public static ArrayLong unmodifiableList(ArrayLong list)
Returns an unmodifiable view of the specified list.- Parameters:
list- the list for which an unmodifiable view is to be returned.- Returns:
- an unmodifiable view of the specified list.
-
unmodifiableList
public static ArrayInteger unmodifiableList(ArrayInteger list)
Returns an unmodifiable view of the specified list.- Parameters:
list- the list for which an unmodifiable view is to be returned.- Returns:
- an unmodifiable view of the specified list.
-
unmodifiableList
public static ArrayShort unmodifiableList(ArrayShort list)
Returns an unmodifiable view of the specified list.- Parameters:
list- the list for which an unmodifiable view is to be returned.- Returns:
- an unmodifiable view of the specified list.
-
unmodifiableList
public static ArrayByte unmodifiableList(ArrayByte list)
Returns an unmodifiable view of the specified list.- Parameters:
list- the list for which an unmodifiable view is to be returned.- Returns:
- an unmodifiable view of the specified list.
-
unmodifiableListDouble
public static ArrayDouble unmodifiableListDouble(double... values)
Returns an unmodifiableArrayDoublewrapper for the givendoublearray.- Parameters:
values- a primitive array.- Returns:
- an immutable wrapper.
-
unmodifiableListFloat
public static ArrayFloat unmodifiableListFloat(float... values)
Returns an unmodifiableArrayFloatwrapper for the givenfloatarray.- Parameters:
values- a primitive array.- Returns:
- an immutable wrapper.
-
unmodifiableListLong
public static ArrayLong unmodifiableListLong(long... values)
Returns an unmodifiableArrayLongwrapper for the givenlongarray.- Parameters:
values- a primitive array.- Returns:
- an immutable wrapper.
-
unmodifiableListULong
public static ArrayULong unmodifiableListULong(long... values)
Returns an unmodifiableArrayULongwrapper for the given unsignedlongarray.- Parameters:
values- a primitive array.- Returns:
- an immutable wrapper.
-
unmodifiableListInt
public static ArrayInteger unmodifiableListInt(int... values)
Returns an unmodifiableArrayIntegerwrapper for the givenintarray.- Parameters:
values- a primitive array.- Returns:
- an immutable wrapper.
-
unmodifiableListUInt
public static ArrayUInteger unmodifiableListUInt(int... values)
Returns an unmodifiableArrayUIntegerwrapper for the given unsignedintarray.- Parameters:
values- a primitive array.- Returns:
- an immutable wrapper.
-
unmodifiableListShort
public static ArrayShort unmodifiableListShort(short... values)
Returns an unmodifiableArrayShortwrapper for the givenshortarray.- Parameters:
values- a primitive array.- Returns:
- an immutable wrapper.
-
unmodifiableListUShort
public static ArrayUShort unmodifiableListUShort(short... values)
Returns an unmodifiableArrayUShortwrapper for the given unsignedshortarray.- Parameters:
values- a primitive array.- Returns:
- an immutable wrapper.
-
unmodifiableListByte
public static ArrayByte unmodifiableListByte(byte... values)
Returns an unmodifiableArrayBytewrapper for the givenbytearray.- Parameters:
values- a primitive array.- Returns:
- an immutable wrapper.
-
unmodifiableListUByte
public static ArrayUByte unmodifiableListUByte(byte... values)
Returns an unmodifiableArrayUBytewrapper for the given unsignedbytearray.- Parameters:
values- a primitive array.- Returns:
- an immutable wrapper.
-
arrayCopy
public static void arrayCopy(CollectionNumber src, double[] dest, int destPos)
Copies the content of the collection to an array at the desired position.- Parameters:
src- the source number collection.dest- the destination array.destPos- starting position in the destination array.- Throws:
IndexOutOfBoundsException- if copying would cause access of data outside array bounds.NullPointerException- if eithersrcordestisnull.
-
arrayCopy
public static void arrayCopy(CollectionNumber src, float[] dest, int destPos)
Copies the content of the collection to an array at the desired position.- Parameters:
src- the source number collection.dest- the destination array.destPos- starting position in the destination array.- Throws:
IndexOutOfBoundsException- if copying would cause access of data outside array bounds.NullPointerException- if eithersrcordestisnull.
-
arrayCopy
public static void arrayCopy(CollectionNumber src, long[] dest, int destPos)
Copies the content of the collection to an array at the desired position.- Parameters:
src- the source number collection.dest- the destination array.destPos- starting position in the destination array.- Throws:
IndexOutOfBoundsException- if copying would cause access of data outside array bounds.NullPointerException- if eithersrcordestisnull.
-
arrayCopy
public static void arrayCopy(CollectionNumber src, int[] dest, int destPos)
Copies the content of the collection to an array at the desired position.- Parameters:
src- the source number collection.dest- the destination array.destPos- starting position in the destination array.- Throws:
IndexOutOfBoundsException- if copying would cause access of data outside array bounds.NullPointerException- if eithersrcordestisnull.
-
arrayCopy
public static void arrayCopy(CollectionNumber src, short[] dest, int destPos)
Copies the content of the collection to an array at the desired position.- Parameters:
src- the source number collection.dest- the destination array.destPos- starting position in the destination array.- Throws:
IndexOutOfBoundsException- if copying would cause access of data outside array bounds.NullPointerException- if eithersrcordestisnull.
-
arrayCopy
public static void arrayCopy(CollectionNumber src, byte[] dest, int destPos)
Copies the content of the collection to an array at the desired position.- Parameters:
src- the source number collection.dest- the destination array.destPos- starting position in the destination array.- Throws:
IndexOutOfBoundsException- if copying would cause access of data outside array bounds.NullPointerException- if eithersrcordestisnull.
-
-