public final class LongsRef extends Object implements Comparable<LongsRef>, Cloneable
longs
member should never be null; use
EMPTY_LONGS
if necessary.Modifier and Type | Field and Description |
---|---|
static long[] |
EMPTY_LONGS
An empty long array for convenience
|
int |
length
Length of used longs.
|
long[] |
longs
The contents of the LongsRef.
|
int |
offset
Offset of first valid long.
|
Constructor and Description |
---|
LongsRef()
Create a LongsRef with
EMPTY_LONGS |
LongsRef(int capacity)
Create a LongsRef pointing to a new array of size
capacity . |
LongsRef(long[] longs,
int offset,
int length)
This instance will directly reference longs w/o making a copy.
|
Modifier and Type | Method and Description |
---|---|
LongsRef |
clone() |
int |
compareTo(LongsRef other)
Signed int order comparison
|
void |
copyLongs(LongsRef other) |
static LongsRef |
deepCopyOf(LongsRef other)
Creates a new IntsRef that points to a copy of the longs from
other |
boolean |
equals(Object other) |
void |
grow(int newLength)
Used to grow the reference array.
|
int |
hashCode() |
boolean |
longsEquals(LongsRef other) |
String |
toString() |
public static final long[] EMPTY_LONGS
public long[] longs
null
.public int offset
public int length
public LongsRef()
EMPTY_LONGS
public LongsRef(int capacity)
capacity
.
Offset and length will both be zero.public LongsRef(long[] longs, int offset, int length)
public boolean longsEquals(LongsRef other)
public int compareTo(LongsRef other)
compareTo
in interface Comparable<LongsRef>
public void copyLongs(LongsRef other)
public void grow(int newLength)
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.