org.extex.interpreter.primitives.register.hash
Class NamedHashToks

java.lang.Object
  extended by org.extex.interpreter.type.AbstractCode
      extended by org.extex.interpreter.type.AbstractAssignment
          extended by org.extex.interpreter.primitives.register.hash.NamedHashToks
All Implemented Interfaces:
java.io.Serializable, Code, Theable
Direct Known Subclasses:
NumberedHashToks

public class NamedHashToks
extends AbstractAssignment
implements Theable

This class provides an implementation for the hash-toks valued primitives. It sets the named pair register to the value given, and as a side effect all prefixes are zeroed.

Example

 \myhash{ {key1}{value1} {key2}{value2} {key3}{value3}}
 \myhash={ {key1}{value1} {key2}{value2} {key3}{value3}}
 

Version:
$Revision: 6447 $
Author:
Michael Niedermair
See Also:
Serialized Form

Constructor Summary
NamedHashToks(CodeToken token, java.lang.String key)
          Creates a new object.
 
Method Summary
 void assign(Flags prefix, Context context, TokenSource source, Typesetter typesetter)
          The method assign is the core of the functionality of execute().
protected  java.lang.String getKey(Context context, TokenSource source, Typesetter typesetter)
          Return the key (the name of the primitive) for the register.
 Tokens the(Context context, TokenSource source, Typesetter typesetter)
          This method is the getter for the description of the primitive.
 
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
 

Constructor Detail

NamedHashToks

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

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

assign

public void assign(Flags prefix,
                   Context context,
                   TokenSource source,
                   Typesetter typesetter)
            throws HelpingException,
                   TypesetterException
Description copied from class: AbstractAssignment
The method assign is the core of the functionality of execute(). This method is preferable to execute() since the execute() method provided in this class takes care of \afterassignment and \globaldefs as well.

Specified by:
assign in class AbstractAssignment
Parameters:
prefix - the prefix controlling the execution
context - the interpreter context
source - the token source
typesetter - the typesetter
Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter
See Also:
AbstractAssignment.assign( org.extex.interpreter.Flags, org.extex.interpreter.context.Context, org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)

the

public Tokens the(Context context,
                  TokenSource source,
                  Typesetter typesetter)
           throws CatcodeException,
                  HelpingException,
                  TypesetterException
This method is the getter for the description of the primitive.

Specified by:
the in interface Theable
Parameters:
context - the interpreter context
source - the source for further tokens to qualify the request
typesetter - the typesetter to use
Returns:
the description of the primitive as list of Tokens
Throws:
CatcodeException - in case of an error in token creation
ConfigurationException - in case of an configuration error
TypesetterException - in case of an error in the typesetter
HelpingException - in case of an error
See Also:
Theable.the( org.extex.interpreter.context.Context, org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)

getKey

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

Parameters:
context - the context
source - the source
typesetter - te typesetter
Returns:
the key
Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter