Package com.yahoo.text
Class AbstractUtf8Array
- java.lang.Object
-
- com.yahoo.text.AbstractUtf8Array
-
- All Implemented Interfaces:
java.lang.Comparable<AbstractUtf8Array>
- Direct Known Subclasses:
Utf8Array
public abstract class AbstractUtf8Array extends java.lang.Object implements java.lang.Comparable<AbstractUtf8Array>
- Since:
- 5.2
- Author:
- baldersheim
-
-
Constructor Summary
Constructors Constructor Description AbstractUtf8Array()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Utf8Array
ascii7BitLowerCase()
int
compareTo(AbstractUtf8Array rhs)
boolean
equals(java.lang.Object o)
byte
getByte(int index)
This will return the byte at the given position.abstract int
getByteLength()
protected abstract int
getByteOffset()
protected abstract byte[]
getBytes()
int
hashCode()
boolean
isEmpty()
java.lang.String
toString()
Will convert the utf8 sequence to a Java stringjava.nio.ByteBuffer
wrap()
Wraps the utf8 sequence in a ByteBuffervoid
writeTo(java.nio.ByteBuffer target)
This will write the utf8 sequence to the given target.
-
-
-
Method Detail
-
writeTo
public final void writeTo(java.nio.ByteBuffer target)
This will write the utf8 sequence to the given target.
-
getByte
public byte getByte(int index)
This will return the byte at the given position.
-
getByteLength
public abstract int getByteLength()
- Returns:
- Length in bytes of the utf8 sequence.
-
wrap
public java.nio.ByteBuffer wrap()
Wraps the utf8 sequence in a ByteBuffer- Returns:
- The wrapping buffer.
-
getBytes
protected abstract byte[] getBytes()
- Returns:
- The backing byte array.
-
isEmpty
public boolean isEmpty()
-
getByteOffset
protected abstract int getByteOffset()
- Returns:
- The offset in the backing array where the utf8 sequence starts.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
Will convert the utf8 sequence to a Java string- Overrides:
toString
in classjava.lang.Object
- Returns:
- The converted Java String
-
compareTo
public int compareTo(AbstractUtf8Array rhs)
- Specified by:
compareTo
in interfacejava.lang.Comparable<AbstractUtf8Array>
-
ascii7BitLowerCase
public Utf8Array ascii7BitLowerCase()
-
-