public class WordsLongConverter extends Object implements LongConverter
WordsLongConverter class implements the LongConverter interface.
Its primary purpose is to convert long numbers into their equivalent word representation using a predefined word list.
The word list is sourced from the 'common-words.txt' file associated with this class.
For example, a long value might be represented by a sequence of words from this list.
| Constructor and Description |
|---|
WordsLongConverter()
Default constructor that initializes the WordsLongConverter with a dot ('.') as the default separator.
|
WordsLongConverter(char sep)
Constructor that initializes the WordsLongConverter with a specified separator character.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(net.openhft.chronicle.bytes.Bytes<?> bytes,
long value)
Appends the word representation of the given long value to the provided Bytes object.
|
void |
append(StringBuilder text,
long value)
Appends the word representation of the given long value to the provided StringBuilder.
|
long |
parse(CharSequence text)
Parses the provided text to produce a long value.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddEncode, allSafeChars, allSafeChars, asString, asText, asText, forSymbols, lengthCheck, lengthCheck, maxParseLength, maxParseLength, parsepublic WordsLongConverter()
public WordsLongConverter(char sep)
sep - The separator character to use between words in the word representation.public long parse(CharSequence text)
parse in interface LongConvertertext - The sequence of words to parse.IllegalArgumentException - If a word in the sequence is not recognized.public void append(StringBuilder text, long value)
append in interface LongConvertertext - The StringBuilder to append to.value - The long value to be converted and appended.public void append(net.openhft.chronicle.bytes.Bytes<?> bytes,
long value)
append in interface LongConverterbytes - The Bytes object to append to.value - The long value to be converted and appended.Copyright © 2024. All rights reserved.