org.extex.core.count
Class CountConstant

java.lang.Object
  extended by org.extex.core.count.CountConstant
All Implemented Interfaces:
java.io.Serializable, FixedCount
Direct Known Subclasses:
Count

public class CountConstant
extends java.lang.Object
implements FixedCount, java.io.Serializable

This class provides an implementation of a Count where no methods modifying the contents are available.

Version:
$Revision:$
Author:
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
protected  long value
          The field value contains the value of the count register.
 
Constructor Summary
CountConstant()
          Creates a new object.
CountConstant(FixedCount value)
          Creates a new object.
CountConstant(long value)
          Creates a new object.
 
Method Summary
 boolean eq(FixedCount count)
          Compare the value for equality.
 boolean ge(FixedCount count)
          Compare the value for a greater or equal value.
 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.
 boolean ne(FixedCount count)
          Compare the value for non-equality.
 java.lang.String toString()
          Determine the printable representation of the object.
 void toString(java.lang.StringBuffer sb)
          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

serialVersionUID

protected static final long serialVersionUID
The constant serialVersionUID contains the id for serialization.

See Also:
Constant Field Values

value

protected long value
The field value contains the value of the count register. Note: This variable is protected to avoid that the derived class Count has to excessively use getters and setters.

Constructor Detail

CountConstant

public CountConstant(FixedCount value)
Creates a new object.

Parameters:
value - the value to be stored

CountConstant

public CountConstant(long value)
Creates a new object.

Parameters:
value - the value to be stored

CountConstant

public CountConstant()
Creates a new object.

Method Detail

eq

public boolean eq(FixedCount count)
Compare the value for equality.

Specified by:
eq in interface FixedCount
Parameters:
count - the count to compare to
Returns:
true iff count has an equal value to the current one
See Also:
FixedCount.eq( org.extex.core.count.FixedCount)

ge

public boolean ge(FixedCount count)
Compare the value for a greater or equal value.

Specified by:
ge in interface FixedCount
Parameters:
count - the count to compare to
Returns:
true iff count has an value greater or equal to the current one
See Also:
FixedCount.ge( org.extex.core.count.FixedCount)

getValue

public long getValue()
Getter for the value

Specified by:
getValue in interface FixedCount
Returns:
the value

gt

public boolean gt(FixedCount count)
Compare the value for a greater value.

Specified by:
gt in interface FixedCount
Parameters:
count - the count to compare to
Returns:
true iff count has an value greater than the current one
See Also:
FixedCount.gt( org.extex.core.count.FixedCount)

le

public boolean le(FixedCount count)
Compare the value for a less or equal value.

Specified by:
le in interface FixedCount
Parameters:
count - the count to compare to
Returns:
true iff count has an value less or equal to the current one
See Also:
FixedCount.le( org.extex.core.count.FixedCount)

lt

public boolean lt(FixedCount count)
Compare the value for a lesser value.

Specified by:
lt in interface FixedCount
Parameters:
count - the count to compare to
Returns:
true iff count has an value less than the current one
See Also:
FixedCount.lt( org.extex.core.count.FixedCount)

ne

public boolean ne(FixedCount count)
Compare the value for non-equality.

Specified by:
ne in interface FixedCount
Parameters:
count - the count to compare to
Returns:
true iff count has an value not equal to the current one
See Also:
FixedCount.ne( org.extex.core.count.FixedCount)

toString

public java.lang.String toString()
Determine the printable representation of the object. The value returned is exactly the string which would be produced by TeX to print the Count.

Specified by:
toString in interface FixedCount
Overrides:
toString in class java.lang.Object
Returns:
the printable representation
See Also:
toString(StringBuffer), Object.toString()

toString

public void toString(java.lang.StringBuffer sb)
Determine the printable representation of the object. The value returned is exactly the string which would be produced by TeX to print the Count.

Specified by:
toString in interface FixedCount
Parameters:
sb - the target string buffer
See Also:
toString(), FixedCount.toString(java.lang.StringBuffer)