public final class IntsRef extends Object implements Comparable<IntsRef>, Cloneable
ints
member should never be null; use
EMPTY_INTS
if necessary.Modifier and Type | Field and Description |
---|---|
static int[] |
EMPTY_INTS
An empty integer array for convenience
|
int[] |
ints
The contents of the IntsRef.
|
int |
length
Length of used ints.
|
int |
offset
Offset of first valid integer.
|
Constructor and Description |
---|
IntsRef()
Create a IntsRef with
EMPTY_INTS |
IntsRef(int capacity)
Create a IntsRef pointing to a new array of size
capacity . |
IntsRef(int[] ints,
int offset,
int length)
This instance will directly reference ints w/o making a copy.
|
Modifier and Type | Method and Description |
---|---|
IntsRef |
clone()
Returns a shallow clone of this instance (the underlying ints are
not copied and will be shared by both the returned object and this
object.
|
int |
compareTo(IntsRef other)
Signed int order comparison
|
void |
copyInts(IntsRef other) |
static IntsRef |
deepCopyOf(IntsRef other)
Creates a new IntsRef that points to a copy of the ints from
other |
boolean |
equals(Object other) |
void |
grow(int newLength)
Used to grow the reference array.
|
int |
hashCode() |
boolean |
intsEquals(IntsRef other) |
boolean |
isValid()
Performs internal consistency checks.
|
String |
toString() |
public static final int[] EMPTY_INTS
public int[] ints
null
.public int offset
public int length
public IntsRef()
EMPTY_INTS
public IntsRef(int capacity)
capacity
.
Offset and length will both be zero.public IntsRef(int[] ints, int offset, int length)
public IntsRef clone()
clone
in class Object
deepCopyOf(org.apache.lucene.util.IntsRef)
public boolean intsEquals(IntsRef other)
public int compareTo(IntsRef other)
compareTo
in interface Comparable<IntsRef>
public void copyInts(IntsRef other)
public void grow(int newLength)
public static IntsRef deepCopyOf(IntsRef 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.