org.extex.base.parser
Class GlueComponentParser

java.lang.Object
  extended by org.extex.base.parser.GlueComponentParser

public class GlueComponentParser
extends java.lang.Object

This class provides a means to store floating numbers with an order.

Examples

 123 pt
 -123 pt
 123.456 pt
 123.pt
 .465 pt
 -.456pt
 +456pt
 

Version:
$Revision:4399 $
Author:
Gerd Neugebauer, Michael Niedermair

Method Summary
static GlueComponent attachUnit(long value, Context context, TokenSource source, Typesetter typesetter, boolean fixed)
          Convert a value by scanning a unit and storing its converted value in a GlueComponent.
protected static Localizer getMyLocalizer()
          Getter for the localizer.
static GlueComponent parse(Context context, TokenSource source, Typesetter typesetter, boolean fixed)
          Creates a new object.
static GlueComponent parse(TokenSource source, Context context, Typesetter typesetter)
          Creates a new object from a TokenStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMyLocalizer

protected static Localizer getMyLocalizer()
Getter for the localizer. The localizer is associated with the name of the class GlueComponent.

Returns:
the localizer

parse

public static GlueComponent parse(Context context,
                                  TokenSource source,
                                  Typesetter typesetter,
                                  boolean fixed)
                           throws HelpingException,
                                  TypesetterException
Creates a new object.

Parameters:
context - the interpreter context
source - the source for the tokens to be read
typesetter - the typesetter
fixed - if true then no glue order is allowed
Returns:
a new instance with the value from the input stream
Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter

attachUnit

public static GlueComponent attachUnit(long value,
                                       Context context,
                                       TokenSource source,
                                       Typesetter typesetter,
                                       boolean fixed)
                                throws HelpingException,
                                       TypesetterException
Convert a value by scanning a unit and storing its converted value in a GlueComponent.

Parameters:
context - the interpreter context
source - the source for the tokens to be read
typesetter - the typesetter
fixed - if true then no glue order is allowed
value - the value to encapsulate
Returns:
the value converted into a GlueComponent or null if no suitable unit could be found
Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter

parse

public static GlueComponent parse(TokenSource source,
                                  Context context,
                                  Typesetter typesetter)
                           throws HelpingException,
                                  TypesetterException
Creates a new object from a TokenStream.

Parameters:
source - the source for new tokens
context - the interpreter context
typesetter - the typesetter
Returns:
a new instance with the value from the input stream
Throws:
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter