public final class NumericConstant extends Object implements Atom
| Modifier and Type | Field and Description |
|---|---|
static NumericConstant |
ONE |
static NumericConstant |
TWO |
static NumericConstant |
ZERO |
| Constructor and Description |
|---|
NumericConstant(Number value)
Creates a numeric constant based on a
Number representation. |
NumericConstant(String text)
Creates a numeric constant.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
accept(NodeVisitor<T> visitor)
Accept a visitor to process this node.
|
String |
getText()
Get the text content for this nodes
|
Number |
getValue()
Returns the number representation of this constant.
|
String |
toString() |
public static final NumericConstant ZERO
public static final NumericConstant ONE
public static final NumericConstant TWO
public NumericConstant(String text)
text - the text representationNumberFormatException - if the text is not in a numeric formatpublic Number getValue()
public String getText()
Atompublic <T> T accept(NodeVisitor<T> visitor)
ExpressionNodeaccept in interface ExpressionNodeT - the type of the visitorvisitor - The visitorCopyright © 2017 The Apache Software Foundation. All rights reserved.