|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sc3d.apt.sss.v3.Token org.sc3d.apt.sss.v3.SSSNumber
public class SSSNumber
A subclass of Token that represents an SSS number, or any prefix thereof.
Field Summary | |
---|---|
int |
exponentLength
The number of characters occupied by the optional exponent part of this SSSNumber, if present, or '0', if absent. |
int |
fractionLength
The number of characters occupied by the optional fractional part of this SSSNumber, if present, or '0', if absent. |
int |
integerLength
The number of characters occupied by the integer part of this SSSNumber. |
Fields inherited from class org.sc3d.apt.sss.v3.Token |
---|
length, sentence, start, type, TYPE_BRACE, TYPE_CHAR, TYPE_COMMENT, TYPE_CONSTANT, TYPE_IDENTIFIER, TYPE_NUMBER, TYPE_ROUND, TYPE_SQUARE, TYPE_STRING, TYPE_WORD |
Constructor Summary | |
---|---|
SSSNumber(Sentence sentence,
int start,
int integerLength,
int fractionLength,
int exponentLength)
Constructs an SSSNumber, given values for its fields. |
Method Summary | |
---|---|
char |
getBase()
Returns the base character of this SSSNumber. |
java.lang.String |
getExponentDigits()
Returns the digits of the exponent part of this SSSNumber. |
java.lang.String |
getFractionDigits()
Returns the digits of the fractional part of this SSSNumber. |
java.lang.String |
getIntegerDigits()
Returns the digits of the integer part of this SSSNumber. |
java.lang.String |
getMantissa()
Returns the concatenation of the integer and fraction digits. |
int |
getRadix()
Returns '2', '4', '8', '10' or '16' depending on the base in which this number is written. |
int |
getShift()
Returns the exponent minus the number of fractional digits. |
boolean |
isExponentNegative()
Returns 'true' if the exponent part is present and includes the optional '-' sign. |
static SSSNumber |
lex(Sentence sentence,
int start)
Constructs an SSSNumber by reading from the middle of a Sentence. |
Methods inherited from class org.sc3d.apt.sss.v3.Token |
---|
addError, equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final int integerLength
public final int fractionLength
public final int exponentLength
Constructor Detail |
---|
public SSSNumber(Sentence sentence, int start, int integerLength, int fractionLength, int exponentLength)
Method Detail |
---|
public static SSSNumber lex(Sentence sentence, int start)
sentence
- the sentence to read.start
- the index of the first character of the number.
public java.lang.String getIntegerDigits()
public java.lang.String getFractionDigits()
public char getBase()
public boolean isExponentNegative()
public java.lang.String getExponentDigits()
public java.lang.String getMantissa()
public int getRadix()
public int getShift()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |