Package ints
Class LongArray
- java.lang.Object
-
- ints.LongArray
-
public class LongArray extends java.lang.ObjectInterface
LongArrayrepresents an immutablelong[]array.
-
-
Constructor Summary
Constructors Constructor Description LongArray(long[] values)Constructs aLongArrayinstance from the specified values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringasString(LongArray ia)Returns a string representation of thisLongArrayby applyingjava.utils.Arrays.toString()to an equivalentint[]object.static booleanequals(LongArray a, LongArray b)Returnstrueif the specifiedLongArrayobjects represent the same sequence of long values, and returnsfalseotherwise.longget(int index)Returns the specified array element.intsize()Returns the number of elements in thisLongArray.static long[]toArray(LongArray la)Returns a copy of the specified array.
-
-
-
Method Detail
-
size
public int size()
Returns the number of elements in thisLongArray.- Returns:
- the number of elements in this
LongArray
-
get
public long get(int index)
Returns the specified array element.- Parameters:
index- an array index- Returns:
- the specified array element
- Throws:
java.lang.IndexOutOfBoundsException- ifindex < 0 || index >= this.size()
-
toArray
public static long[] toArray(LongArray la)
Returns a copy of the specified array.- Parameters:
la- a list of longs- Returns:
- a copy of the specified array
- Throws:
java.lang.NullPointerException- ifia == null
-
asString
public static java.lang.String asString(LongArray ia)
Returns a string representation of thisLongArrayby applyingjava.utils.Arrays.toString()to an equivalentint[]object.- Parameters:
ia- a list of longs- Returns:
- a string representation of this
LongArray. - Throws:
java.lang.NullPointerException- ifia == null
-
equals
public static boolean equals(LongArray a, LongArray b)
Returnstrueif the specifiedLongArrayobjects represent the same sequence of long values, and returnsfalseotherwise.- Parameters:
a- a sequence of long valuesb- a sequence of long values- Returns:
trueif the specifiedLongArrayobjects represent the same sequence of long values
-
-