org.apache.lucene.util
Class LongsRef

java.lang.Object
  extended by org.apache.lucene.util.LongsRef
All Implemented Interfaces:
Cloneable, Comparable<LongsRef>

public final class LongsRef
extends Object
implements Comparable<LongsRef>, Cloneable

Represents long[], as a slice (offset + length) into an existing long[]. The longs member should never be null; use EMPTY_LONGS if necessary.

NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

Field Summary
static long[] EMPTY_LONGS
           
 int length
           
 long[] longs
           
 int offset
           
 
Constructor Summary
LongsRef()
           
LongsRef(int capacity)
           
LongsRef(long[] longs, int offset, int length)
           
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_LONGS

public static final long[] EMPTY_LONGS

longs

public long[] longs

offset

public int offset

length

public int length
Constructor Detail

LongsRef

public LongsRef()

LongsRef

public LongsRef(int capacity)

LongsRef

public LongsRef(long[] longs,
                int offset,
                int length)
Method Detail

clone

public LongsRef clone()
Overrides:
clone in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

longsEquals

public boolean longsEquals(LongsRef other)

compareTo

public int compareTo(LongsRef other)
Signed int order comparison

Specified by:
compareTo in interface Comparable<LongsRef>

copyLongs

public void copyLongs(LongsRef other)

grow

public void grow(int newLength)
Used to grow the reference array. In general this should not be used as it does not take the offset into account.

NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

toString

public String toString()
Overrides:
toString in class Object

deepCopyOf

public static LongsRef deepCopyOf(LongsRef other)
Creates a new IntsRef that points to a copy of the longs from other

The returned IntsRef will have a length of other.length and an offset of zero.



Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.