de.dante.extex.interpreter.context.impl
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: 1.42 $
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)
           
 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.
 Count 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)
           
 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

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

Parameters:
observer - the observer to register

afterGroup

public 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

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

Returns:
the after group tokens

getBox

public 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

public 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

public 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

public 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

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

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

getDimen

public 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

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

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

getIf

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

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

getInFile

public 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

public 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

public 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

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

Returns:
the locator

getMathcode

public 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

public 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

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

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

getNext

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

Returns:
the next group

getOutFile

public 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

public Count 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

public 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

public TokenStream getStandardTokenStream()
Getter for standardTokenStream.

Returns:
the standardTokenStream

getStart

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

Returns:
the start token

getToks

public 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

public 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

public GroupType getType()
Getter for the group type.

Returns:
the group type

getTypesettingContext

public TypesettingContext getTypesettingContext()
Getter for the typesetting context.

Returns:
the typesetting context

getUccode

public 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

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

Throws:
InterpreterException - in case of an error

setBox

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public void setLocator(Locator locator)
Setter for the locator.

Parameters:
locator - the locator

setMathcode

public 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

public 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

public 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

public 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

public 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

public 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

public void setStandardTokenStream(TokenStream standardTokenStream)
Setter for standardTokenStream.

Parameters:
standardTokenStream - the standardTokenStream to set.

setStart

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

Parameters:
start - the start token

setToks

public 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

public void setType(GroupType type)
Setter for the type.

Parameters:
type - the type of the group

setTypesettingContext

public 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

public 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

public java.lang.Object get(java.lang.Object extension,
                            java.lang.Object key)

set

public void set(java.lang.Object extension,
                java.lang.Object key,
                java.lang.Object value,
                boolean global)