public class PrimitiveLongArray extends AbstractPrimitiveArray
Constructor and Description |
---|
PrimitiveLongArray()
Default constructor
|
PrimitiveLongArray(PrimitiveLongArray sourceArray)
Copying constructor
|
Modifier and Type | Method and Description |
---|---|
long[] |
asArray()
Get a reference to a long[] that represents the contents of this array.
|
static <A extends PrimitiveLongArray> |
copyInstance(A source)
Create a new <A extends
PrimitiveLongArray > instance, using a copy constructor to
replicate the contents of the given source array |
static <A extends PrimitiveLongArray> |
copyInstance(java.lang.invoke.MethodHandles.Lookup lookup,
A source)
Create a new <A extends
PrimitiveLongArray > instance, using a copy constructor to
replicate the contents of the given source array |
long |
get(int index)
Get the value of an element in the array.
|
long |
get(long index)
Get the value of an element in the array.
|
long |
getLength()
Get the length of the array
|
static <A extends PrimitiveLongArray> |
newInstance(java.lang.Class<A> arrayClass,
long length)
Create a new instance of <A extends
PrimitiveLongArray > with a given length. |
static <A extends PrimitiveLongArray> |
newInstance(CtorAndArgs<A> arrayCtorAndArgs,
long length)
Create a new instance of <A extends
PrimitiveLongArray > with a given length,
array constructor, and array constructor arguments. |
static PrimitiveLongArray |
newInstance(long length)
Create a new instance of
PrimitiveLongArray with a given length. |
static <A extends PrimitiveLongArray> |
newInstance(long length,
java.lang.reflect.Constructor<A> arrayConstructor,
java.lang.Object... arrayConstructorArgs)
Create a new instance of <A extends
PrimitiveLongArray > with a given length,
array constructor, and array constructor arguments. |
static <A extends PrimitiveLongArray> |
newInstance(java.lang.invoke.MethodHandles.Lookup lookup,
java.lang.Class<A> arrayClass,
long length)
Create a new instance of <A extends
PrimitiveLongArray > with a given length. |
void |
set(int index,
long value)
set the value of an element in the array.
|
void |
set(long index,
long value)
set the value of an element in the array.
|
public PrimitiveLongArray()
public PrimitiveLongArray(PrimitiveLongArray sourceArray)
sourceArray
- the array to copypublic long[] asArray()
java.lang.IllegalStateException
- if array is too long to represent as a long[]public long getLength()
public long get(int index)
index
- the index of the elementpublic long get(long index)
index
- the index of the elementpublic void set(int index, long value)
index
- the index of the element to setvalue
- the value to assign to the elementpublic void set(long index, long value)
index
- the index of the element to setvalue
- the value to assign to the elementpublic static PrimitiveLongArray newInstance(long length)
PrimitiveLongArray
with a given length.length
- the length of the array.PrimitiveLongArray
with the given lengthpublic static <A extends PrimitiveLongArray> A newInstance(java.lang.Class<A> arrayClass, long length)
PrimitiveLongArray
> with a given length.A
- The class of the array to be created (extends PrimitiveLongArray)arrayClass
- The class of the array to be created (extends PrimitiveLongArray)length
- the length of the array.PrimitiveLongArray
> with a given lengthpublic static <A extends PrimitiveLongArray> A newInstance(java.lang.invoke.MethodHandles.Lookup lookup, java.lang.Class<A> arrayClass, long length)
PrimitiveLongArray
> with a given length.A
- The class of the array to be created (extends PrimitiveLongArray)lookup
- The lookup object to use for accessing the array's constructorarrayClass
- The class of the array to be created (extends PrimitiveLongArray)length
- the length of the array.PrimitiveLongArray
> with a given lengthpublic static <A extends PrimitiveLongArray> A newInstance(CtorAndArgs<A> arrayCtorAndArgs, long length)
PrimitiveLongArray
> with a given length,
array constructor, and array constructor arguments.A
- The class of the array to be created (extends PrimitiveLongArray)length
- The length of the array.arrayCtorAndArgs
- for creating the arrayPrimitiveLongArray
>public static <A extends PrimitiveLongArray> A newInstance(long length, java.lang.reflect.Constructor<A> arrayConstructor, java.lang.Object... arrayConstructorArgs)
PrimitiveLongArray
> with a given length,
array constructor, and array constructor arguments.A
- The class of the array to be created (extends PrimitiveLongArray)length
- The length of the array.arrayConstructor
- The array constructor to usearrayConstructorArgs
- The arguments to pass to the array constructorPrimitiveLongArray
>public static <A extends PrimitiveLongArray> A copyInstance(A source) throws java.lang.NoSuchMethodException
PrimitiveLongArray
> instance, using a copy constructor to
replicate the contents of the given source arrayA
- The class of the array to be created (extends PrimitiveLongArray)source
- The array to replicatePrimitiveLongArray
> copied from the source arrayjava.lang.NoSuchMethodException
- if <A> does not have a copy constructorpublic static <A extends PrimitiveLongArray> A copyInstance(java.lang.invoke.MethodHandles.Lookup lookup, A source) throws java.lang.NoSuchMethodException
PrimitiveLongArray
> instance, using a copy constructor to
replicate the contents of the given source arrayA
- The class of the array to be created (extends PrimitiveLongArray)lookup
- The lookup object to use for accessing the array's constructorsource
- The array to replicatePrimitiveLongArray
> copied from the source arrayjava.lang.NoSuchMethodException
- if <A> does not have a copy constructor