Java org.apache.lucene.util BytesRef fields, constructors, methods, implement or subclass

Example usage for Java org.apache.lucene.util BytesRef fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.lucene.util BytesRef.

The text is from its open source code.

Field

nullEMPTY_BYTES
An empty byte array for convenience
intlength
Length of used bytes.

Constructor

BytesRef(byte[] bytes)
This instance will directly reference bytes w/o making a copy.
BytesRef(int capacity)
Create a BytesRef pointing to a new array of size capacity.
BytesRef(CharSequence text)
Initialize the byte[] from the UTF8 bytes for the provided String.
BytesRef()
Create a BytesRef with #EMPTY_BYTES
BytesRef(byte[] bytes, int offset, int length)
This instance will directly reference bytes w/o making a copy.

Method

booleanbytesEquals(BytesRef other)
Expert: compares the bytes against another BytesRef, returning true if the bytes are equal.
BytesRefclone()
Returns a shallow clone of this instance (the underlying bytes are not copied and will be shared by both the returned object and this object.
intcompareTo(BytesRef other)
Unsigned byte order comparison
BytesRefdeepCopyOf(BytesRef other)
Creates a new BytesRef that points to a copy of the bytes from other

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

booleanequals(Object other)
inthashCode()
Calculates the hash code as required by TermsHash during indexing.
StringtoString()
Returns hex encoded bytes, eg [0x6c 0x75 0x63 0x65 0x6e 0x65]
Stringutf8ToString()
Interprets stored bytes as UTF8 bytes, returning the resulting string