de.dante.extex.interpreter.primitives.register.toks
Class ToksParameter

java.lang.Object
  extended byde.dante.extex.interpreter.type.AbstractCode
      extended byde.dante.extex.interpreter.type.AbstractAssignment
          extended byde.dante.extex.interpreter.primitives.register.toks.AbstractToks
              extended byde.dante.extex.interpreter.primitives.register.toks.ToksPrimitive
                  extended byde.dante.extex.interpreter.primitives.register.toks.ToksParameter
All Implemented Interfaces:
Code, Configurable, InitializableCode, Localizable, java.io.Serializable, Theable, TokensConvertible

public class ToksParameter
extends ToksPrimitive
implements InitializableCode, Configurable

This class provides an implementation for the primitive \toks. It sets the numbered toks register to the value given, and as a side effect all prefixes are zeroed. Example:

  \toks12{123}
 

Version:
$Revision: 1.14 $
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
ToksParameter(java.lang.String name)
          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 number) for the tokens register.
static java.lang.String getKey(java.lang.String name, Context context)
          Return the key for a named toks register.
 void init(Context context, TokenSource source, Typesetter typesetter)
          Initialize the Code with some value coming from a String.
 
Methods inherited from class de.dante.extex.interpreter.primitives.register.toks.ToksPrimitive
assign, convertTokens, expand, the
 
Methods inherited from class de.dante.extex.interpreter.type.AbstractAssignment
execute
 
Methods inherited from class de.dante.extex.interpreter.type.AbstractCode
enableLocalization, getLocalizer, getName, isIf, isOuter, printable, printableControlSequence, readResolve, setName, toString
 
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

ToksParameter

public ToksParameter(java.lang.String name)
Creates a new object.

Parameters:
name - the name for debugging
Method Detail

getKey

public static java.lang.String getKey(java.lang.String name,
                                      Context context)
Return the key for a named toks register.

Parameters:
name - the name of the register
context - the interpreter context to use
Returns:
the key for the toks register

configure

public void configure(Configuration config)
               throws ConfigurationException
Description copied from interface: Configurable
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( de.dante.util.framework.configuration.Configuration)

getKey

protected java.lang.String getKey(Context context,
                                  TokenSource source,
                                  Typesetter typesetter)
Return the key (the number) for the tokens register.

Overrides:
getKey in class AbstractToks
Parameters:
source - the source for the next tokens – if required
context - the interpreter context to use
typesetter - the typesetter
Returns:
the key for the tokens register

init

public void init(Context context,
                 TokenSource source,
                 Typesetter typesetter)
          throws InterpreterException
Description copied from interface: InitializableCode
Initialize the Code with some value coming from a String.

Specified by:
init in interface InitializableCode
Parameters:
context - the interpreter context
source - the source of information for the initialization
typesetter - the typesetter
Throws:
InterpreterException - in case of an error
See Also:
InitializableCode.init( de.dante.extex.interpreter.context.Context, TokenSource, Typesetter)