Package ints
Class LongArray
- java.lang.Object
-
- ints.LongArray
-
public class LongArray extends java.lang.Object
Interface
LongArray
represents an immutablelong[]
array.
-
-
Constructor Summary
Constructors Constructor Description LongArray(long[] values)
Constructs aLongArray
instance from the specified values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
asString(LongArray ia)
Returns a string representation of thisLongArray
by applyingjava.utils.Arrays.toString()
to an equivalentint[]
object.static boolean
equals(LongArray a, LongArray b)
Returnstrue
if the specifiedLongArray
objects represent the same sequence of long values, and returnsfalse
otherwise.long
get(int index)
Returns the specified array element.int
size()
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 thisLongArray
by 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)
Returnstrue
if the specifiedLongArray
objects represent the same sequence of long values, and returnsfalse
otherwise.- Parameters:
a
- a sequence of long valuesb
- a sequence of long values- Returns:
true
if the specifiedLongArray
objects represent the same sequence of long values
-
-