de.dante.extex.interpreter.primitives.math.delimiter
Class AbstractTeXDelimiter

java.lang.Object
  extended byde.dante.extex.interpreter.type.AbstractCode
      extended byde.dante.extex.interpreter.primitives.math.AbstractMathCode
          extended byde.dante.extex.interpreter.primitives.math.delimiter.AbstractTeXDelimiter
All Implemented Interfaces:
Code, Localizable, java.io.Serializable
Direct Known Subclasses:
Abovewithdelims, Atopwithdelims, Delimiter, Left, Middle, Overwithdelims, Radical, Right

public abstract class AbstractTeXDelimiter
extends AbstractMathCode

This abstract class adds the ability to translate MathDelimiters to and from their TeX encoding as numbers to abstract math code.

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

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
AbstractTeXDelimiter(java.lang.String name)
          Creates a new object.
 
Method Summary
static long delimiterToLong(MathDelimiter del)
          Translate the delimiter into a TeX encoded number or throw an exception if this is not possible.
protected static Localizer getMyLocalizer()
          Create a localizer for this class.
static MathDelimiter newMathDelimiter(long delcode)
          Creates a new MathDelimiter object from the TeX encoding.
static MathDelimiter parseDelimiter(Context context, TokenSource source, Typesetter typesetter, java.lang.String primitive)
          Parse a math delimiter.
 
Methods inherited from class de.dante.extex.interpreter.primitives.math.AbstractMathCode
getListMaker
 
Methods inherited from class de.dante.extex.interpreter.type.AbstractCode
enableLocalization, execute, 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

AbstractTeXDelimiter

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

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

getMyLocalizer

protected static Localizer getMyLocalizer()
Create a localizer for this class.

Returns:
the localizer

newMathDelimiter

public static MathDelimiter newMathDelimiter(long delcode)
                                      throws InterpreterException
Creates a new MathDelimiter object from the TeX encoding.

The TeX encoding interprets the number as 27 bit hex number: "csyylxx. Here the digits have the following meaning:

c
the math class of this delimiter. It has a range from 0 to 7.
l
the family for the large character. It has a range from 0 to 15.
xx
the character code of the large character.
s
the family for the small character. It has a range from 0 to 15.
yy
the character code of the small character.

Parameters:
delcode - the TeX encoding for the delimiter
Returns:
a new MathDelimiter
Throws:
InterpreterException - in case of a parameter out of range

parseDelimiter

public static MathDelimiter parseDelimiter(Context context,
                                           TokenSource source,
                                           Typesetter typesetter,
                                           java.lang.String primitive)
                                    throws InterpreterException
Parse a math delimiter.
  \delimiter"1234567
  \delimiter open 22 `[ 1 `(
 

Parameters:
context - the interpreter context
source - the token source to read from
typesetter - the typesetter
primitive - the name of the primitive for error handling
Returns:
the MathDelimiter acquired
Throws:
InterpreterException - in case of an error

delimiterToLong

public static long delimiterToLong(MathDelimiter del)
                            throws HelpingException
Translate the delimiter into a TeX encoded number or throw an exception if this is not possible.

Parameters:
del - the delimiter to encode
Returns:
the TeX encoded delimiter
Throws:
HelpingException - in case of an error