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<?> destination,
long numericValue)
Appends a long value to a Bytes object.
|
void |
append(StringBuilder destinationBuilder,
long numericValue)
Appends a long value to a StringBuilder.
|
int |
maxParseLength()
Returns the maximum number of characters that this converter can parse.
|
long |
parse(CharSequence textToParse)
Parses a sequence of characters into a long value.
|
long |
parse(CharSequence textToParse,
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, 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 textToParse)
parse in interface LongConvertertextToParse - the character sequence to parseIllegalArgumentException - if the character sequence contains unexpected characters or
its length exceeds the maximum allowable length.public long parse(CharSequence textToParse, int beginIndex, int endIndex)
parse in interface LongConvertertextToParse - the character sequence to parsebeginIndex - the beginning index, inclusiveendIndex - the ending index, exclusiveIllegalArgumentException - 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 destinationBuilder, long numericValue)
append in interface LongConverterdestinationBuilder - the StringBuilder to append tonumericValue - the long value to appendpublic void append(net.openhft.chronicle.bytes.Bytes<?> destination,
long numericValue)
append in interface LongConverterdestination - the Bytes object to append tonumericValue - 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 © 2026 Chronicle Software Ltd. All rights reserved.