|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.opmath.util.dmldoc.ParseCounter
An object representing a general-purpose counter.
ParseCounter methods are strictly imited to those required by
the SGML parser contained within com.opmath.util.dmldoc.DMLDoc.
The chief advantage of this class is that it provides a full object wrapper
around an int. Thus, it is possible to pass a ParseCounter
into a method as a formal argument, then obtain its updated value on return.
Copyright: (c) 2002 The Open Math Company Limited
The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.
DMLDoc| Field Summary | |
static int |
NEGATIVE
Returned by value(). |
static int |
POSITIVE
Returned by value(). |
static int |
ZERO
Returned by value(). |
| Constructor Summary | |
ParseCounter(int newVal)
Constructs a new ParseCounter whose starting value is given
by newVal. |
|
| Method Summary | |
void |
dec()
Decrements the value of this ParseCounter instance by 1. |
void |
inc()
Increments the value of this ParseCounter instance by 1. |
boolean |
negative()
Returns true iff the value of this ParseCounter instance
is less than zero. |
boolean |
positive()
Returns true iff the value of this ParseCounter instance
is greater than zero. |
String |
toString()
Returns a new String, detailing the contents of this
ParseCounter instance. |
int |
value()
Returns an int representing the state of the counter. |
boolean |
zero()
Returns true iff the value of this ParseCounter instance
is zero. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int POSITIVE
Returned by value().
value()public static final int ZERO
Returned by value().
value()public static final int NEGATIVE
Returned by value().
value()| Constructor Detail |
public ParseCounter(int newVal)
Constructs a new ParseCounter whose starting value is given
by newVal.
newVal - the starting value for this ParseCounter.| Method Detail |
public void inc()
Increments the value of this ParseCounter instance by 1.
com.opmath.util.dmldoc.ParseCounter.public void dec()
Decrements the value of this ParseCounter instance by 1.
com.opmath.util.dmldoc.ParseCounter.public boolean zero()
Returns true iff the value of this ParseCounter instance
is zero.
boolean.public boolean positive()
Returns true iff the value of this ParseCounter instance
is greater than zero.
boolean.public boolean negative()
Returns true iff the value of this ParseCounter instance
is less than zero.
boolean.public int value()
Returns an int representing the state of the counter.
Thus:
value() returns
com.opmath.util.dmldoc.ParseCounter.POSITIVEvalue() returns
com.opmath.util.dmldoc.ParseCounter.NEGATIVEvalue() returns
com.opmath.util.dmldoc.ParseCounter.ZEROint.public String toString()
Returns a new String, detailing the contents of this
ParseCounter instance.
toString in class ObjectString.
|
OpMath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||