org.extex.unit.tex.math.delimiter
Class AbstractTeXDelimiter

java.lang.Object
  extended by org.extex.interpreter.type.AbstractCode
      extended by org.extex.unit.tex.math.AbstractMathCode
          extended by org.extex.unit.tex.math.delimiter.AbstractTeXDelimiter
All Implemented Interfaces:
java.io.Serializable, Code
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:4431 $
Author:
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
AbstractTeXDelimiter(CodeToken token)
          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, CodeToken primitive)
          Parse a math delimiter.
 
Methods inherited from class org.extex.unit.tex.math.AbstractMathCode
getListMaker
 
Methods inherited from class org.extex.interpreter.type.AbstractCode
execute, 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

AbstractTeXDelimiter

public AbstractTeXDelimiter(CodeToken token)
Creates a new object.

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

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

getMyLocalizer

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

Returns:
the localizer

newMathDelimiter

public static MathDelimiter newMathDelimiter(long delcode)
                                      throws HelpingException
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:
HelpingException - in case of a parameter out of range

parseDelimiter

public static MathDelimiter parseDelimiter(Context context,
                                           TokenSource source,
                                           Typesetter typesetter,
                                           CodeToken primitive)
                                    throws HelpingException,
                                           ConfigurationException,
                                           TypesetterException
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:
HelpingException - in case of an error
ConfigurationException - in case of an configuration error
TypesetterException - in case of an error in the typesetter