|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dante.extex.interpreter.type.count.Count
This class represents a long integer value. It is used for instance as count register.
Field Summary | |
static Count |
ONE
The constant ONE contains the count register with the value 1. |
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
static Count |
THOUSAND
The constant THOUSAND contains the count register with the value 1000. |
static Count |
ZERO
The constant ZERO contains the count register with the value 0. |
Constructor Summary | |
Count(FixedCount count)
Creates a new object. |
|
Count(long value)
Creates a new object. |
Method Summary | |
void |
add(long val)
Add a long to the value. |
void |
divide(long denom)
Divide the value by a long. |
boolean |
eq(FixedCount count)
Compare the value for equality. |
boolean |
ge(FixedCount count)
Compare the value for a greater or equal value. |
protected Localizer |
getLocalizer()
Getter for the localizer. |
long |
getValue()
Getter for the value |
boolean |
gt(FixedCount count)
Compare the value for a greater value. |
boolean |
le(FixedCount count)
Compare the value for a less or equal value. |
boolean |
lt(FixedCount count)
Compare the value for a lesser value. |
void |
multiply(long factor)
Multiply the value with a factor. |
boolean |
ne(FixedCount count)
Compare the value for non-equality. |
static Count |
parse(Context context,
TokenSource source,
Typesetter typesetter)
parse a token stream for a count value. |
static long |
scanInteger(Context context,
TokenSource source,
Typesetter typesetter)
Scan the input stream for tokens making up an integer, this is a number optionally preceded by a sign (+ or -). |
static long |
scanNumber(Context context,
TokenSource source,
Typesetter typesetter)
Scan the input stream for tokens making up a number, i.e. |
static long |
scanNumber(Context context,
TokenSource source,
Typesetter typesetter,
Token token)
Scan the input stream for tokens making up a number, this is a sequence of digits with category code OTHER. |
void |
set(long l)
Setter for the value. |
void |
setValue(long l)
Setter for the value. |
java.lang.String |
toString()
Determine the printable representation of the object. |
void |
toString(java.lang.StringBuffer sb)
Determine the printable representation of the object. |
Tokens |
toToks(Context context)
Determine the printable representation of the object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Count ONE
protected static final long serialVersionUID
public static final Count THOUSAND
public static final Count ZERO
Constructor Detail |
public Count(FixedCount count)
count
- the reference to be copiedpublic Count(long value)
value
- the valueMethod Detail |
public static long scanInteger(Context context, TokenSource source, Typesetter typesetter) throws InterpreterException
This method parses the following syntactic entity:
〈number〉
A number consists of a non-empty sequence of digits with category code
OTHER
. The number is
optionally preceded by white space and a sign + or -.
Tokens are expanded while gathering the requested values.
context
- the processor contextsource
- the source for new tokenstypesetter
- the typesetter to use for conversion
InterpreterException
- in case of an errorpublic static long scanNumber(Context context, TokenSource source, Typesetter typesetter) throws InterpreterException
This method implements the generalization of several syntactic
definitions from
〈number〉
A number consists of a non-empty sequence of digits with category code
OTHER
.
context
- the processor contextsource
- the source for new tokenstypesetter
- the typesetter
InterpreterException
- in case that no number is found or the
end of file has been reached before an integer could be acquiredpublic static long scanNumber(Context context, TokenSource source, Typesetter typesetter, Token token) throws InterpreterException
context
- the processor contextsource
- the source for new tokenstypesetter
- the typesettertoken
- the first token
InterpreterException
- in case that no number is found or the
end of file has been reached before an integer could be acquiredpublic static Count parse(Context context, TokenSource source, Typesetter typesetter) throws InterpreterException
context
- the processor contextsource
- the source for new tokenstypesetter
- the typesetter
InterpreterException
- in case of an errorpublic void add(long val)
val
- the value to add topublic void divide(long denom) throws ArithmeticOverflowException
denom
- the denominator to divide by
ArithmeticOverflowException
- in case of a division by zeropublic boolean eq(FixedCount count)
FixedCount
eq
in interface FixedCount
count
- the count to compare to
true
iff count has an equal value to the current
oneFixedCount.eq(
de.dante.extex.interpreter.type.count.FixedCount)
public boolean ge(FixedCount count)
FixedCount
ge
in interface FixedCount
count
- the count to compare to
true
iff count has an value greater or equal to the
current oneFixedCount.ge(
de.dante.extex.interpreter.type.count.FixedCount)
protected Localizer getLocalizer()
public long getValue()
getValue
in interface FixedCount
public boolean gt(FixedCount count)
FixedCount
gt
in interface FixedCount
count
- the count to compare to
true
iff count has an value greater than the
current oneFixedCount.gt(
de.dante.extex.interpreter.type.count.FixedCount)
public boolean le(FixedCount count)
FixedCount
le
in interface FixedCount
count
- the count to compare to
true
iff count has an value less or equal to the
current oneFixedCount.le(
de.dante.extex.interpreter.type.count.FixedCount)
public boolean lt(FixedCount count)
FixedCount
lt
in interface FixedCount
count
- the count to compare to
true
iff count has an value less than the
current oneFixedCount.lt(
de.dante.extex.interpreter.type.count.FixedCount)
public void multiply(long factor)
factor
- the factor to multiply withpublic boolean ne(FixedCount count)
FixedCount
ne
in interface FixedCount
count
- the count to compare to
true
iff count has an value not equal to the
current oneFixedCount.ne(
de.dante.extex.interpreter.type.count.FixedCount)
public void set(long l)
l
- the new valuesetValue(long)
public void setValue(long l)
l
- the new valueset(long)
public java.lang.String toString()
toString
in interface FixedCount
toString(StringBuffer)
public void toString(java.lang.StringBuffer sb)
toString
in interface FixedCount
sb
- the target string buffertoString()
public Tokens toToks(Context context) throws InterpreterException
toToks
in interface FixedCount
context
- the interpreter context
InterpreterException
- in case of an error
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |