PackedString16, PackedString24, PackedString32, PackedString40, PackedString48, PackedString56, PackedString64, PackedString8, PackedStringNpublic abstract class PackedString extends Object
| Constructor | Description |
|---|---|
PackedString() |
| Modifier and Type | Method | Description |
|---|---|---|
static Object |
convert(String s) |
Converts a String to a PackedString, or a String.
|
static Object |
convert(String s,
boolean intern) |
|
protected static int |
get(byte[] bytes,
int index) |
Retrieve the index-th byte as an int.
|
(package private) PackedString |
intern() |
|
static Object |
intern(Object o) |
Converts a (valid) object to an intern version.
|
protected abstract byte[] |
toBytes() |
|
String |
toString() |
protected static int get(byte[] bytes,
int index)
Conversion is done by setting low byte of the resulting int to the extracted value, and setting other bytes to 0.
bytes - The bytes array.index - The byte index.protected abstract byte[] toBytes()
PackedString intern()
public static Object intern(Object o)
o - The object. Must be null or a String or a PackedString.o.IllegalArgumentException - When o is neither null, nor a String nor a PackedString.public static Object convert(String s)
s is null returns null.
s is empty, returns "".
s.
s - The String to convert.s to a packed equivalent.Copyright © 2019. All rights reserved.