org.extex.interpreter.max.context
Interface Group

All Superinterfaces:
java.io.Serializable, Tokenizer
All Known Subinterfaces:
GroupExtension
All Known Implementing Classes:
GroupExtensionImpl, GroupImpl

public interface Group
extends Tokenizer, java.io.Serializable

This is the implementation of a group object. A group is the container for all data which might have group local values. In contrast to TeX the groups are organized as linked objects. A new group contains just the values which have local definitions. Thus the opening and closing of groups are rather fast. The access to the value might be slow when many groups have to be passed to find the one containing the value.

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

Method Summary
 void afterGroup(AfterGroupObserver observer)
          Register an observer to be invoked after the group has been closed.
 void afterGroup(Token t)
          Add the token to the tokens to be inserted after the group is closed.
 java.lang.Object get(java.lang.Object extension, java.lang.Object key)
          Get some extension object stored in the group.
 Tokens getAfterGroup()
          Getter for the tokens which are inserted after the group has been closed.
 Box getBox(java.lang.String name)
          Getter for the boxregister.
 Catcode getCatcode(UnicodeChar c)
          Getter for the catcode of a character.
 Code getCode(CodeToken token)
          Getter for the definition of an active character or macro.
 Count getCount(java.lang.String name)
          Getter for the named count register in the current group.
 MathDelimiter getDelcode(UnicodeChar uc)
          Getter for the delcode of a character.
 Dimen getDimen(java.lang.String name)
          Getter for the named dimen register in the current group.
 Font getFont(java.lang.String name)
          Getter for the current font.
 boolean getIf(java.lang.String name)
          Getter for the boolean value.
 InFile getInFile(java.lang.String name)
          Getter for the input file descriptor.
 UnicodeChar getLccode(UnicodeChar uc)
          Getter for the lccode mapping of upper case characters to their lower case equivalent.
 long getLevel()
          Getter for the group level.
 Locator getLocator()
          Getter for the locator describing where the group started.
 MathCode getMathcode(UnicodeChar uc)
          Getter for the math code of a character.
 Muskip getMuskip(java.lang.String name)
          Getter for the named muskip register in the current group.
 java.lang.String getNamespace()
          Getter for the current name space.
 Group getNext()
          Getter for the next group in the linked list.
 OutFile getOutFile(java.lang.String name)
          Getter for the output file descriptor.
 FixedCount getSfcode(UnicodeChar uc)
          Getter for the space factor code of a character.
 Glue getSkip(java.lang.String name)
          Getter for the named skip register in the current group.
 TokenStream getStandardTokenStream()
          Getter for standardTokenStream.
 Token getStart()
          Getter for the token which started the group.
 Tokens getToks(java.lang.String name)
          Getter for the named toks register in the current group.
 Tokens getToksOrNull(java.lang.String name)
          Getter for the named toks register in the current group.
 GroupType getType()
          Getter for the group type.
 TypesettingContext getTypesettingContext()
          Getter for the typesetting context.
 UnicodeChar getUccode(UnicodeChar lc)
          Getter for the uccode mapping of lower case characters to their upper case equivalent.
 void runAfterGroup()
          Invoke all registered observers for the end-of-group event.
 void set(java.lang.Object extension, java.lang.Object key, java.lang.Object value, boolean global)
          Store some extension object in the group.
 void setBox(java.lang.String name, Box value, boolean global)
          Setter for the box register in all requested groups.
 void setCatcode(UnicodeChar c, Catcode code, boolean global)
          Setter for the catcode of a character in the specified groups.
 void setCode(Token token, Code code, boolean global)
          Setter for active characters or macros in the requested group.
 void setCount(java.lang.String name, Count value, boolean global)
          Setter for a count register in the requested groups.
 void setDelcode(UnicodeChar uc, MathDelimiter code, boolean global)
          Setter for the delcode of a character.
 void setDimen(java.lang.String name, Dimen value, boolean global)
          Setter for a dimen register in the requested groups.
 void setFont(java.lang.String name, Font font, boolean global)
          Setter for the font with a given name.
 void setIf(java.lang.String name, boolean value, boolean global)
          Setter for the value of the booleans in all groups.
 void setInFile(java.lang.String name, InFile file, boolean global)
          Setter for an input file.
 void setLccode(UnicodeChar uc, UnicodeChar lc, boolean global)
          Declare the translation from an upper case character to a lower case character.
 void setLocator(Locator locator)
          Setter for the locator.
 void setMathcode(UnicodeChar uc, MathCode code, boolean global)
          Setter for the math code of a character.
 void setMuskip(java.lang.String name, Muskip value, boolean global)
          Setter for the muskip register in the requested groups.
 void setNamespace(java.lang.String namespace, boolean global)
          Setter for the name space.
 void setOutFile(java.lang.String name, OutFile file, boolean global)
          Setter for the output file for a given name.
 void setSfcode(UnicodeChar uc, Count code, boolean global)
          Setter for the space factor code of a character.
 void setSkip(java.lang.String name, Glue value, boolean global)
          Setter for a skip register in all groups.
 void setStandardTokenStream(TokenStream standardTokenStream)
          Setter for standardTokenStream.
 void setStart(Token start)
          Setter for the start token.
 void setToks(java.lang.String name, Tokens value, boolean global)
          Setter for a toks register in all groups.
 void setType(GroupType type)
          Setter for the type.
 void setTypesettingContext(TypesettingContext context, boolean global)
          Setter for the typesetting context in the specified groups.
 void setUccode(UnicodeChar lc, UnicodeChar uc, boolean global)
          Declare the translation from a lower case character to an upper case character.
 

Method Detail

afterGroup

void afterGroup(AfterGroupObserver observer)
Register an observer to be invoked after the group has been closed.

Parameters:
observer - the observer to register

afterGroup

void afterGroup(Token t)
Add the token to the tokens to be inserted after the group is closed.

Parameters:
t - the token to add

getAfterGroup

Tokens getAfterGroup()
Getter for the tokens which are inserted after the group has been closed.

Returns:
the after group tokens

getBox

Box getBox(java.lang.String name)
Getter for the boxregister. Count registers are named, either with a number or an arbitrary string. The numbered registers where limited to 256 in TeX. This restriction does no longer hold for ExTeX.

Parameters:
name - the name or number of the count register
Returns:
the count register or null if it is not defined

getCatcode

Catcode getCatcode(UnicodeChar c)
Getter for the catcode of a character.

Specified by:
getCatcode in interface Tokenizer
Parameters:
c - the Unicode character to analyze
Returns:
the catcode of a character

getCode

Code getCode(CodeToken token)
Getter for the definition of an active character or macro.

Parameters:
token - the name of the active character or macro
Returns:
the code associated to the name or null if none is defined yet

getCount

Count getCount(java.lang.String name)
Getter for the named count register in the current group. The name can either be a string representing a number or an arbitrary string. In the first case the behavior of the numbered count registers is emulated. The other case can be used to store special count values.

Note: The number of count registers is not limited to 256 as in TeX.

As a default value 0 is returned.

Parameters:
name - the name of the count register
Returns:
the value of the count register or its default

getDelcode

MathDelimiter getDelcode(UnicodeChar uc)
Getter for the delcode of a character. The delcode is -1 unless changed explicitly.

Parameters:
uc - the character to get the delcode for
Returns:
the delcode for the given character

getDimen

Dimen getDimen(java.lang.String name)
Getter for the named dimen register in the current group. The name can either be a string representing a number or an arbitrary string. In the first case the behavior of the numbered dimen registers is emulated. The other case can be used to store special dimen values.

Note: The number of dimen registers is not limited to 256 as in TeX.

As a default value 0 is returned.

Parameters:
name - the name of the dimen register
Returns:
the value of the dimen register or its default

getFont

Font getFont(java.lang.String name)
Getter for the current font.

Parameters:
name - the name of the font
Returns:
the current font

getIf

boolean getIf(java.lang.String name)
Getter for the boolean value.

Parameters:
name - the name of the boolean
Returns:
the value

getInFile

InFile getInFile(java.lang.String name)
Getter for the input file descriptor. In the case that the named descriptor doe not exist yet a new one is returned.

Parameters:
name - the name of the descriptor to get
Returns:
the input file descriptor

getLccode

UnicodeChar getLccode(UnicodeChar uc)
Getter for the lccode mapping of upper case characters to their lower case equivalent.

Parameters:
uc - the upper case character
Returns:
the lower case equivalent or null if none exists

getLevel

long getLevel()
Getter for the group level. The group level is the number of groups which are currently open. Thus this number of groups can be closed. Since the top-level group can not be closed this group counts as 0.

Returns:
the group level

getLocator

Locator getLocator()
Getter for the locator describing where the group started.

Returns:
the locator

getMathcode

MathCode getMathcode(UnicodeChar uc)
Getter for the math code of a character.

Parameters:
uc - the character to get the math code for
Returns:
the math code for the given character

getMuskip

Muskip getMuskip(java.lang.String name)
Getter for the named muskip register in the current group. The name can either be a string representing a number or an arbitrary string. In the first case the behavior of the numbered muskip registers is emulated. The other case can be used to store special muskip values.

Note: The number of muskip registers is not limited to 256 as in TeX.

As a default value 0 is returned.

Parameters:
name - the name of the count register
Returns:
the value of the count register or its default

getNamespace

java.lang.String getNamespace()
Getter for the current name space.

Specified by:
getNamespace in interface Tokenizer
Returns:
the current name space

getNext

Group getNext()
Getter for the next group in the linked list. Maybe this method should be hidden.

Returns:
the next group

getOutFile

OutFile getOutFile(java.lang.String name)
Getter for the output file descriptor.

Parameters:
name - the name of the descriptor to get
Returns:
the output file descriptor

getSfcode

FixedCount getSfcode(UnicodeChar uc)
Getter for the space factor code of a character. The sfcode is 999 for letters and 1000 for other characters unless changed explicitly.

Parameters:
uc - the character for which the sfcode is requested
Returns:
the sfcode of the given character

getSkip

Glue getSkip(java.lang.String name)
Getter for the named skip register in the current group. The name can either be a string representing a number or an arbitrary string. In the first case the behavior of the numbered skip registers is emulated. The other case can be used to store special skip values.

Note: The number of skip registers is not limited to 256 as in TeX.

As a default value 0 is returned.

Parameters:
name - the name of the count register
Returns:
the value of the count register or its default

getStandardTokenStream

TokenStream getStandardTokenStream()
Getter for standardTokenStream.

Returns:
the standardTokenStream

getStart

Token getStart()
Getter for the token which started the group.

Returns:
the start token

getToks

Tokens getToks(java.lang.String name)
Getter for the named toks register in the current group. The name can either be a string representing a number or an arbitrary string. In the first case the behavior of the numbered toks registers is emulated. The other case can be used to store special toks values.

Note: The number of toks registers is not limited to 256 as in TeX.

As a default value the empty toks register is returned.

Parameters:
name - the name of the toks register
Returns:
the value of the toks register or its default

getToksOrNull

Tokens getToksOrNull(java.lang.String name)
Getter for the named toks register in the current group. The name can either be a string representing a number or an arbitrary string. In the first case the behavior of the numbered toks registers is emulated. The other case can be used to store special toks values.

Note: The number of toks registers is not limited to 256 as in TeX.

Parameters:
name - the name of the toks register
Returns:
the value of the toks register or null if none is defined

getType

GroupType getType()
Getter for the group type.

Returns:
the group type

getTypesettingContext

TypesettingContext getTypesettingContext()
Getter for the typesetting context.

Returns:
the typesetting context

getUccode

UnicodeChar getUccode(UnicodeChar lc)
Getter for the uccode mapping of lower case characters to their upper case equivalent.

Parameters:
lc - the upper case character
Returns:
the upper case equivalent or null if none exists

runAfterGroup

void runAfterGroup()
                   throws HelpingException
Invoke all registered observers for the end-of-group event.

Throws:
HelpingException - in case of an error

setBox

void setBox(java.lang.String name,
            Box value,
            boolean global)
Setter for the box register in all requested groups. Count registers are named, either with a number or an arbitrary string. The numbered registers where limited to 256 in TeX. This restriction does no longer hold for ExTeX.

Parameters:
name - the name or the number of the register
value - the new value of the register
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setCatcode

void setCatcode(UnicodeChar c,
                Catcode code,
                boolean global)
Setter for the catcode of a character in the specified groups.

Parameters:
c - the character
code - the catcode
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setCode

void setCode(Token token,
             Code code,
             boolean global)
Setter for active characters or macros in the requested group.

Parameters:
token - the name of the active character, i.e. a single letter string
code - the new code
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setCount

void setCount(java.lang.String name,
              Count value,
              boolean global)
Setter for a count register in the requested groups.

Parameters:
name - the name of the count register
value - the value of the count register
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setDelcode

void setDelcode(UnicodeChar uc,
                MathDelimiter code,
                boolean global)
Setter for the delcode of a character.

Parameters:
uc - the character to set the delcode for
code - the new delcode
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setDimen

void setDimen(java.lang.String name,
              Dimen value,
              boolean global)
Setter for a dimen register in the requested groups.

Parameters:
name - the name of the count register
value - the value of the count register
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setFont

void setFont(java.lang.String name,
             Font font,
             boolean global)
Setter for the font with a given name.

Parameters:
name - the name of the font
font - the new font
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setIf

void setIf(java.lang.String name,
           boolean value,
           boolean global)
Setter for the value of the booleans in all groups.

Parameters:
name - the name of the boolean
value - the truth value
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setInFile

void setInFile(java.lang.String name,
               InFile file,
               boolean global)
Setter for an input file.

Parameters:
name - the name of the input file
file - the input file specification
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setLccode

void setLccode(UnicodeChar uc,
               UnicodeChar lc,
               boolean global)
Declare the translation from an upper case character to a lower case character.

Parameters:
uc - upper case character
lc - lower case equivalent
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setLocator

void setLocator(Locator locator)
Setter for the locator.

Parameters:
locator - the locator

setMathcode

void setMathcode(UnicodeChar uc,
                 MathCode code,
                 boolean global)
Setter for the math code of a character.

Parameters:
uc - the character to set the math code for
code - the new math code
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setMuskip

void setMuskip(java.lang.String name,
               Muskip value,
               boolean global)
Setter for the muskip register in the requested groups.

Parameters:
name - the name of the register
value - the value of the register
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setNamespace

void setNamespace(java.lang.String namespace,
                  boolean global)
Setter for the name space.

Parameters:
namespace - the new name space
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setOutFile

void setOutFile(java.lang.String name,
                OutFile file,
                boolean global)
Setter for the output file for a given name.

Parameters:
name - the name of the output file
file - the output file specification
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setSfcode

void setSfcode(UnicodeChar uc,
               Count code,
               boolean global)
Setter for the space factor code of a character.

Parameters:
uc - the character to set the space factor code for
code - the new space factor code
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setSkip

void setSkip(java.lang.String name,
             Glue value,
             boolean global)
Setter for a skip register in all groups.

Parameters:
name - the name of the count register
value - the value of the count register
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setStandardTokenStream

void setStandardTokenStream(TokenStream standardTokenStream)
Setter for standardTokenStream.

Parameters:
standardTokenStream - the standardTokenStream to set.

setStart

void setStart(Token start)
Setter for the start token.

Parameters:
start - the start token

setToks

void setToks(java.lang.String name,
             Tokens value,
             boolean global)
Setter for a toks register in all groups.

Parameters:
name - the name of the toks register
value - the value of the toks register
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setType

void setType(GroupType type)
Setter for the type.

Parameters:
type - the type of the group

setTypesettingContext

void setTypesettingContext(TypesettingContext context,
                           boolean global)
Setter for the typesetting context in the specified groups.

Parameters:
context - the new typesetting context
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

setUccode

void setUccode(UnicodeChar lc,
               UnicodeChar uc,
               boolean global)
Declare the translation from a lower case character to an upper case character.

Parameters:
lc - lower case character
uc - uppercase equivalent
global - the indicator for the scope; true means all groups; otherwise the current group is affected only

get

java.lang.Object get(java.lang.Object extension,
                     java.lang.Object key)
Get some extension object stored in the group.

Parameters:
extension - the reference for the extension
key - the key of the object
Returns:
the object stored for the extension under the given key or null if none is there

set

void set(java.lang.Object extension,
         java.lang.Object key,
         java.lang.Object value,
         boolean global)
Store some extension object in the group.

Parameters:
extension - the reference for the extension
key - the key of the object
value - the value to store
global - the indicator that the assignment should be performed globally