java.lang.Object
swim.codec.Base10
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
countDigits
(int value) Returns the number of decimal digits in the given absolutevalue
.static int
countDigits
(long value) Returns the number of decimal digits in the given absolutevalue
.static int
decodeDigit
(int c) Returns the decimal quantity between0
(inclusive) and10
(exclusive) represented by the base-10 digitc
.doubleWriter
(long input) Returns aWriter
continuation that writes the base-10 (decimal) encoding of theinput
value.static int
encodeDigit
(int b) Returns the Unicode code point of the base-10 digit that encodes the given decimal quantity between0
(inclusive) and10
(exclusive).floatWriter
(long input) Returns aWriter
continuation that writes the base-10 (decimal) encoding of theinput
value.Returns aWriter
that, when fed an inputInteger
value, returns a continuation that writes the base-10 (decimal) encoding of the input value.intWriter
(int input) Returns aWriter
continuation that writes the base-10 (decimal) encoding of theinput
value.static boolean
isDigit
(int c) Returnstrue
if the Unicode code pointc
is a valid base-10 digit.Returns aWriter
that, when fed an inputLong
value, returns a continuation that writes the base-10 (decimal) encoding of the input value.longWriter
(long input) Returns aWriter
continuation that writes the base-10 (decimal) encoding of theinput
value.parseDecimal
(Input input) parseInteger
(Input input) parseNumber
(Input input) static Writer<?,
?> writeDouble
(Output<?> output, double input) Writes the base-10 (decimal) encoding of theinput
value to theoutput
, returning aWriter
continuation that knows how to write any remaining output that couldn't be immediately generated.static Writer<?,
?> writeFloat
(Output<?> output, float input) Writes the base-10 (decimal) encoding of theinput
value to theoutput
, returning aWriter
continuation that knows how to write any remaining output that couldn't be immediately generated.static Writer<?,
?> Writes the base-10 (decimal) encoding of theinput
value to theoutput
, returning aWriter
continuation that knows how to write any remaining output that couldn't be immediately generated.static Writer<?,
?> Writes the base-10 (decimal) encoding of theinput
value to theoutput
, returning aWriter
continuation that knows how to write any remaining output that couldn't be immediately generated.
-
Method Details
-
parseNumber
-
parseDecimal
-
parseInteger
-
numberParser
-
decimalParser
-
integerParser
-
intWriter
Returns aWriter
that, when fed an inputInteger
value, returns a continuation that writes the base-10 (decimal) encoding of the input value. -
intWriter
Returns aWriter
continuation that writes the base-10 (decimal) encoding of theinput
value. -
longWriter
Returns aWriter
that, when fed an inputLong
value, returns a continuation that writes the base-10 (decimal) encoding of the input value. -
longWriter
Returns aWriter
continuation that writes the base-10 (decimal) encoding of theinput
value. -
floatWriter
Returns aWriter
continuation that writes the base-10 (decimal) encoding of theinput
value. -
doubleWriter
Returns aWriter
continuation that writes the base-10 (decimal) encoding of theinput
value. -
writeInt
Writes the base-10 (decimal) encoding of theinput
value to theoutput
, returning aWriter
continuation that knows how to write any remaining output that couldn't be immediately generated. -
writeLong
Writes the base-10 (decimal) encoding of theinput
value to theoutput
, returning aWriter
continuation that knows how to write any remaining output that couldn't be immediately generated. -
writeFloat
Writes the base-10 (decimal) encoding of theinput
value to theoutput
, returning aWriter
continuation that knows how to write any remaining output that couldn't be immediately generated. -
writeDouble
Writes the base-10 (decimal) encoding of theinput
value to theoutput
, returning aWriter
continuation that knows how to write any remaining output that couldn't be immediately generated. -
isDigit
public static boolean isDigit(int c) Returnstrue
if the Unicode code pointc
is a valid base-10 digit. -
decodeDigit
public static int decodeDigit(int c) Returns the decimal quantity between0
(inclusive) and10
(exclusive) represented by the base-10 digitc
.- Throws:
IllegalArgumentException
- ifc
is not a valid base-10 digit.
-
encodeDigit
public static int encodeDigit(int b) Returns the Unicode code point of the base-10 digit that encodes the given decimal quantity between0
(inclusive) and10
(exclusive). -
countDigits
public static int countDigits(int value) Returns the number of decimal digits in the given absolutevalue
. -
countDigits
public static int countDigits(long value) Returns the number of decimal digits in the given absolutevalue
.
-