org.extex.unit.tex.register.count
Class IntegerParameter

java.lang.Object
  extended by org.extex.interpreter.type.AbstractCode
      extended by org.extex.interpreter.type.AbstractAssignment
          extended by org.extex.unit.tex.register.count.AbstractCount
              extended by org.extex.unit.tex.register.count.CountPrimitive
                  extended by org.extex.unit.tex.register.count.IntegerParameter
All Implemented Interfaces:
java.io.Serializable, Configurable, CountConvertible, Code, Advanceable, Divideable, Multiplyable, ExpandableCode, InitializableCode, Theable

public class IntegerParameter
extends CountPrimitive
implements InitializableCode, Configurable

This class provides an implementation for the count valued primitives like \day. It sets the named count register to the value given, and as a side effect all prefixes are zeroed.

Example

  \day=345
 

Version:
$Revision: 4770 $
Author:
Gerd Neugebauer, Michael Niedermair
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
IntegerParameter(CodeToken token)
          Creates a new object.
IntegerParameter(CodeToken token, java.lang.String key)
          Creates a new object.
 
Method Summary
 void configure(Configuration config)
          Configure an object according to a given Configuration.
protected  java.lang.String getKey(Context context, TokenSource source, Typesetter typesetter)
          Return the key (the name of the primitive) for the numbered count register.
 void init(Context context, TokenSource source, Typesetter typesetter)
          Initialize the Code with some value coming from a String.
 
Methods inherited from class org.extex.unit.tex.register.count.CountPrimitive
advance, assign, convertCount, divide, expand, multiply, the
 
Methods inherited from class org.extex.interpreter.type.AbstractAssignment
execute
 
Methods inherited from class org.extex.interpreter.type.AbstractCode
getLocalizer, getName, getToken, isIf, isOuter, readResolve, toString, toText, toText
 
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

IntegerParameter

public IntegerParameter(CodeToken token)
Creates a new object.

Parameters:
token - the initial token for the primitive

IntegerParameter

public IntegerParameter(CodeToken token,
                        java.lang.String key)
Creates a new object.

Parameters:
token - the initial token for the primitive
key - the key
Method Detail

configure

public void configure(Configuration config)
               throws ConfigurationException
Configure an object according to a given Configuration.

Specified by:
configure in interface Configurable
Parameters:
config - the configuration object to consider
Throws:
ConfigurationException - in case that something went wrong
See Also:
Configurable.configure( org.extex.framework.configuration.Configuration)

getKey

protected java.lang.String getKey(Context context,
                                  TokenSource source,
                                  Typesetter typesetter)
Return the key (the name of the primitive) for the numbered count register.

Overrides:
getKey in class AbstractCount
Parameters:
context - the interpreter context to use
source - the source for new tokens
typesetter - the typesetter
Returns:
the key for the current register
See Also:
AbstractCount.getKey( org.extex.interpreter.context.Context, org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)

init

public void init(Context context,
                 TokenSource source,
                 Typesetter typesetter)
          throws HelpingException,
                 TypesetterException
Initialize the Code with some value coming from a String.

Specified by:
init in interface InitializableCode
Overrides:
init in class AbstractCount
Parameters:
context - the interpreter context
source - the source of information for the initialization
typesetter - the typesetter
Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter
See Also:
InitializableCode.init( org.extex.interpreter.context.Context, org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)