public class SymbolsLongConverter extends Object implements LongConverter
LongConverter interface for
converting long values to and from strings using arbitrary bases, specifically
those not necessarily in powers of two.
This converter efficiently manages conversion using provided symbols, allowing flexible and adaptable encoding and decoding processes.
| Constructor and Description |
|---|
SymbolsLongConverter(String symbols)
Initializes a new instance with a given set of symbols.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEncode(char alias,
char as)
Adds an alias character for encoding.
|
void |
append(net.openhft.chronicle.bytes.Bytes<?> text,
long value)
Appends a long value to a Bytes object.
|
void |
append(StringBuilder text,
long value)
Appends a long value to a StringBuilder.
|
int |
maxParseLength()
Returns the maximum number of characters that this converter can parse.
|
long |
parse(CharSequence text)
Parses a sequence of characters into a long value.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitallSafeChars, asString, asText, asText, forSymbols, lengthCheck, maxParseLengthpublic SymbolsLongConverter(String symbols)
symbols - A string containing unique symbols for conversion.public int maxParseLength()
LongConvertermaxParseLength in interface LongConverterpublic long parse(CharSequence text)
parse in interface LongConvertertext - the character sequence to parseIllegalArgumentException - if the character sequence contains unexpected characterspublic void append(StringBuilder text, long value)
append in interface LongConvertertext - the StringBuilder to append tovalue - the long value to appendpublic void append(net.openhft.chronicle.bytes.Bytes<?> text,
long value)
append in interface LongConvertertext - the Bytes object to append tovalue - the long value to appendpublic void addEncode(char alias,
char as)
addEncode in interface LongConverteralias - The character to treat as an alias.as - The character that the alias should be treated as.Copyright © 2023. All rights reserved.