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.
|
long |
parse(CharSequence text,
int beginIndex,
int endIndex)
Parses a part of a sequence of characters into a long value.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitallSafeChars, allSafeChars, asString, asText, asText, forSymbols, lengthCheck, 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 parse.IllegalArgumentException - if the character sequence contains unexpected characters or
its length exceeds the maximum allowable length.public long parse(CharSequence text, int beginIndex, int endIndex)
parse in interface LongConvertertext - the character sequence to parse.beginIndex - the beginning index, inclusive.endIndex - the ending index, exclusive.IllegalArgumentException - if the character sequence contains unexpected characters, or if any of the
indices are invalid or the sub-sequence length exceeds the maximum allowable length.public 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 © 2024. All rights reserved.