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

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.AbstractOmegaDelimiter
All Implemented Interfaces:
Code, Localizable, java.io.Serializable
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: 1.2 $
Author:
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
AbstractOmegaDelimiter(java.lang.String name)
          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, 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

AbstractOmegaDelimiter

public AbstractOmegaDelimiter(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 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:
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 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