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()
Returns a shallow clone of this instance (the underlying longs are
not copied and will be shared by both the returned object and this
object.
|
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 |
isValid()
Performs internal consistency checks.
|
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 LongsRef clone()
clone
in class Object
deepCopyOf(org.apache.lucene.util.LongsRef)
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)
public static LongsRef deepCopyOf(LongsRef other)
other
The returned IntsRef will have a length of other.length and an offset of zero.
public boolean isValid()
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.