de.dante.extex.interpreter.type.count
Class ImmutableCount

java.lang.Object
  extended byde.dante.extex.interpreter.type.count.Count
      extended byde.dante.extex.interpreter.type.count.ImmutableCount
All Implemented Interfaces:
FixedCount, java.io.Serializable

public class ImmutableCount
extends Count

This class provides an implementation of a Count where all methods modifying the contents are redefined to produce an exception.

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

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Fields inherited from class de.dante.extex.interpreter.type.count.Count
ONE, THOUSAND, ZERO
 
Constructor Summary
ImmutableCount(FixedCount value)
          Creates a new object.
ImmutableCount(long value)
          Creates a new object.
 
Method Summary
 void add(long val)
          Add a long to the value.
 void divide(long val)
          Divide the value by a long.
 void multiply(long val)
          Multiply the value with a factor.
 
Methods inherited from class de.dante.extex.interpreter.type.count.Count
eq, ge, getLocalizer, getValue, gt, le, lt, ne, parse, scanInteger, scanNumber, scanNumber, set, setValue, toString, toString, toToks
 
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
Constructor Detail

ImmutableCount

public ImmutableCount(long value)
Creates a new object.

Parameters:
value - the value to be stored

ImmutableCount

public ImmutableCount(FixedCount value)
Creates a new object.

Parameters:
value - the value to be stored
Method Detail

add

public void add(long val)
Description copied from class: Count
Add a long to the value. This operation modifies the value.

Overrides:
add in class Count
Parameters:
val - the value to add to
See Also:
Count.add(long)

divide

public void divide(long val)
Description copied from class: Count
Divide the value by a long. This operation modifies the value.

Overrides:
divide in class Count
Parameters:
val - the denominator to divide by
See Also:
Count.divide(long)

multiply

public void multiply(long val)
Description copied from class: Count
Multiply the value with a factor. This operation modifies the value.

Overrides:
multiply in class Count
Parameters:
val - the factor to multiply with
See Also:
Count.multiply(long)