org.extex.unit.omega.math.delimiter
Class AbstractOmegaDelimiter

java.lang.Object
  extended by org.extex.interpreter.type.AbstractCode
      extended by org.extex.unit.tex.math.AbstractMathCode
          extended by org.extex.unit.omega.math.delimiter.AbstractOmegaDelimiter
All Implemented Interfaces:
java.io.Serializable, Code
Direct Known Subclasses:
Odelimiter, Oradical

public abstract class AbstractOmegaDelimiter
extends AbstractMathCode

This abstract class adds the ability to translate MathDelimiters to and from their Omega 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
AbstractOmegaDelimiter(CodeToken token)
          Creates a new object.
 
Method Summary
static long delimiterToLong(MathDelimiter del)
          Translate the delimiter into a Omega 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 Omega 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

AbstractOmegaDelimiter

public AbstractOmegaDelimiter(CodeToken token)
Creates a new object.

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

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 Omega encoding.

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

c
the math class of this delimiter. It has a range from 0 to 7.
ll
the family for the large character. It has a range from 0 to 255.
xxxx
the character code of the large character.
ss
the family for the small character. It has a range from 0 to 255.
yyyy
the character code of the small character.

Parameters:
delcode - the Omega 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 ConfigurationException,
                                           HelpingException,
                                           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:
ConfigurationException - in case of an configuration error
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter

delimiterToLong

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

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