de.dante.extex.interpreter.primitives.format
Class PrintFormat

java.lang.Object
  extended byde.dante.extex.interpreter.type.AbstractCode
      extended byde.dante.extex.interpreter.primitives.format.PrintFormat
All Implemented Interfaces:
Code, Localizable, java.io.Serializable, Theable

public class PrintFormat
extends AbstractCode
implements Theable

This class provides an implementation for the primitive \printformat. It format the next primitive for the output with the given pattern and the default Locale.

Example:

 \the\printformat{pattern}\real7
 

Version:
$Revision: 1.10 $
Author:
Michael Niedermair
See Also:
DecimalFormat, Serialized Form

Constructor Summary
PrintFormat(java.lang.String name)
          Creates a new object.
 
Method Summary
 void execute(Flags prefix, Context context, TokenSource source, Typesetter typesetter)
          Get the next token (not expand) and print it with some format.
 Tokens the(Context context, TokenSource source, Typesetter typesetter)
          This method is the getter for the description of the primitive.
 
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
 

Constructor Detail

PrintFormat

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

Parameters:
name - the name for tracing and debugging
Method Detail

execute

public void execute(Flags prefix,
                    Context context,
                    TokenSource source,
                    Typesetter typesetter)
             throws InterpreterException
Get the next token (not expand) and print it with some format.

Specified by:
execute in interface Code
Overrides:
execute in class AbstractCode
Throws:
InterpreterException
See Also:
Code.execute( de.dante.extex.interpreter.Flags, de.dante.extex.interpreter.context.Context, de.dante.extex.interpreter.TokenSource, de.dante.extex.typesetter.Typesetter)

the

public Tokens the(Context context,
                  TokenSource source,
                  Typesetter typesetter)
           throws InterpreterException
Description copied from interface: Theable
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:
InterpreterException - in case of an error
See Also:
Theable.the( de.dante.extex.interpreter.context.Context, de.dante.extex.interpreter.TokenSource, Typesetter)