public abstract class AbstractNumericLiteral<T>
extends java.lang.Object
| Constructor and Description |
|---|
AbstractNumericLiteral(java.lang.String source)
Sole Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isMalformed()
This method determines whether this literal can be converted to a number accurately.
|
abstract boolean |
isParsable()
This method determines whether this literal would be recognized by the parser.
|
java.lang.String |
source()
This method returns the source-code representation of this literal.
|
java.lang.String |
sourceWithoutUnderscores()
This method returns the source-code representation of this literal with underscores removed.
|
java.lang.String |
toString()
This method returns a string representation of this literal.
|
abstract T |
value()
This method converts this literal to its numeric equivalent.
|
public AbstractNumericLiteral(java.lang.String source)
source - is this literal as it appeared in the source-code.java.lang.NullPointerException - if source is null.java.lang.IllegalArgumentException - if source.length() equals zero.public abstract T value()
public abstract boolean isParsable()
Note: Under some circumstances, a literal may be malformed and parse-able.
public final java.lang.String source()
public final java.lang.String sourceWithoutUnderscores()
public final boolean isMalformed()
public final java.lang.String toString()
toString in class java.lang.Objectsource()