Package com.yahoo.text
Class Utf8String
- java.lang.Object
-
- com.yahoo.text.AbstractUtf8Array
-
- com.yahoo.text.Utf8Array
-
- com.yahoo.text.Utf8String
-
- All Implemented Interfaces:
CharSequence
,Comparable<AbstractUtf8Array>
public final class Utf8String extends Utf8Array implements CharSequence
String with Utf8 backing.- Author:
- baldersheim
-
-
Constructor Summary
Constructors Constructor Description Utf8String(AbstractUtf8Array utf8)
This will create a string based on the utf8 sequence.Utf8String(String str)
This will construct a utf8 backing of the given string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description char
charAt(int index)
boolean
equals(Object o)
int
length()
CharSequence
subSequence(int start, int end)
String
toString()
Retuerns the utf8 sequence as a Java string.-
Methods inherited from class com.yahoo.text.Utf8Array
getByteLength, getByteOffset, getBytes
-
Methods inherited from class com.yahoo.text.AbstractUtf8Array
ascii7BitLowerCase, compareTo, getByte, hashCode, isEmpty, wrap, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Constructor Detail
-
Utf8String
public Utf8String(String str)
This will construct a utf8 backing of the given string.- Parameters:
str
- The string that will be utf8 encoded
-
Utf8String
public Utf8String(AbstractUtf8Array utf8)
This will create a string based on the utf8 sequence.- Parameters:
utf8
- The backing array
-
-
Method Detail
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
-
length
public int length()
- Specified by:
length
in interfaceCharSequence
-
subSequence
public CharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractUtf8Array
-
toString
public String toString()
Description copied from class:AbstractUtf8Array
Retuerns the utf8 sequence as a Java string.- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classAbstractUtf8Array
-
-