public class NumberValue
extends java.langNumber
implements Value
Overlay-backed numeric Value that parses JSON numbers on demand.
| Constructor and description |
|---|
NumberValue(Type type)Creates an uninitialized numeric wrapper for the supplied token type. |
NumberValue()Creates an uninitialized numeric wrapper with no preset token type. |
NumberValue(boolean chop, Type type, int startIndex, int endIndex, char[] buffer)Creates a numeric overlay over a character buffer slice. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public BigDecimal |
bigDecimalValue()* Converts this token to a BigDecimal. * *
|
|
public BigInteger |
bigIntegerValue()* Converts this token to a BigInteger. * *
|
|
public boolean |
booleanValue()* Converts this token to a boolean value. * *
|
|
public byte |
byteValue()* Converts this token to a byte value. * *
|
|
public char |
charValue()* Converts this token to a single character. * *
|
|
public final void |
chop()* Copies any shared backing buffer into a dedicated slice. |
|
public Date |
dateValue()* Converts this token to a Date. * *
|
|
public double |
doubleValue()* Converts this token to a double value. * *
|
|
public boolean |
equals(Object o)Compares the overlay state and cached value. |
|
public float |
floatValue()* Converts this token to a float value. * *
|
|
public int |
hashCode()Returns a hash code for the overlay state and cached value. |
|
public int |
intValue()* Converts this token to an int value. * *
|
|
public boolean |
isContainer()* Indicates whether this value wraps a map or a collection. * *
|
|
public long |
longValue()* Converts this token to a long value. * *
|
|
public short |
shortValue()* Converts this token to a short value. * *
|
|
public String |
stringValue()* Returns the string form using the value's configured decoding policy. * *
|
|
public String |
stringValueEncoded()* Returns the fully decoded string form. * *
|
<T extends Enum> |
public T |
toEnum(Class<T> cls)* Converts this token to an enum constant. * *
|
<T extends Enum> |
public static T |
toEnum(Class<T> cls, int value)Resolves an enum constant from its ordinal. |
|
public String |
toString()Returns the current numeric slice as text. |
|
public final Object |
toValue()* Materializes this token as a regular Java value. * *
|
Creates an uninitialized numeric wrapper for the supplied token type.
type - numeric token typeCreates an uninitialized numeric wrapper with no preset token type.
Creates a numeric overlay over a character buffer slice.
chop - whether to copy the slice immediatelytype - numeric token typestartIndex - slice startendIndex - slice endbuffer - backing buffer* Converts this token to a BigDecimal. * *
* Converts this token to a BigInteger. * *
* Converts this token to a boolean value. * *
* Converts this token to a byte value. * *
* Converts this token to a single character. * *
* Copies any shared backing buffer into a dedicated slice.
* Converts this token to a double value. * *
Compares the overlay state and cached value.
o - other objecttrue when the overlays match* Converts this token to a float value. * *
Returns a hash code for the overlay state and cached value.
* Converts this token to an int value. * *
* Indicates whether this value wraps a map or a collection. * *
true for container values* Converts this token to a long value. * *
* Converts this token to a short value. * *
* Returns the string form using the value's configured decoding policy. * *
* Returns the fully decoded string form. * *
* Converts this token to an enum constant. * *
cls - enum type to resolve
*T - enum type
*Resolves an enum constant from its ordinal.
cls - enum typevalue - ordinal valueT - enum typeReturns the current numeric slice as text.
* Materializes this token as a regular Java value. * *
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.