org.extex.interpreter.max.context
Class ContextImpl

java.lang.Object
  extended by org.extex.interpreter.max.context.ContextImpl
All Implemented Interfaces:
java.io.Serializable, DocumentWriterOptions, Configurable, LogEnabled, Context, ContextCode, ContextCount, ContextDimen, ContextErrorCount, ContextFile, ContextFont, ContextGroup, ContextInteraction, ContextInternals, ContextMark, ContextTokens, CodeObservable, ConditionalObservable, CountObservable, DimenObservable, GlueObservable, GroupObservable, InteractionObservable, LoadedObservable, TokensObservable, LanguageManagerCarrier, Tokenizer, TokenStreamOptions, PageContext, TypesetterOptions
Direct Known Subclasses:
ContextExtensionImpl

public class ContextImpl
extends java.lang.Object
implements ContextInternals, CodeObservable, ConditionalObservable, CountObservable, DimenObservable, GlueObservable, GroupObservable, InteractionObservable, LoadedObservable, TokensObservable, Tokenizer, DocumentWriterOptions, TypesetterOptions, TokenStreamOptions, LogEnabled, Configurable, java.io.Serializable

This is a reference implementation for an interpreter context. The groups are implemented as a linked list of single groups. In contrast to the Knuthian implementation in TeX no undo stack is used.

Several operations have to be dealt with:

Version:
$Revision: 4770 $
Author:
Gerd Neugebauer, Michael Niedermair
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
ContextImpl()
          Creates a new object.
 
Method Summary
 void addUnit(UnitInfo info)
          Add a unit to the list of loaded units.
 void afterGroup(AfterGroupObserver observer)
          Register a observer to be called at the end of the group.
 void afterGroup(Token t)
          Add a token to the tokens inserted after the group has been closed.
 void clearSplitMarks()
          This method clears all split marks.
 void closeGroup(Typesetter typesetter, TokenSource source)
          Perform all actions required upon the closing of a group.
 void configure(Configuration configuration)
          Configure an object according to a given Configuration.
 void enableLogging(java.util.logging.Logger logger)
          Setter for the logger.
 java.lang.String esc(java.lang.String name)
          Attach the current escape character in front of a name and return the result.
 java.lang.String esc(Token token)
          This method is meant to produce a printable version of a control sequence for error messages.
 UnicodeChar escapechar()
          Return the current escape character or \0 if it is undefined.
 java.lang.Object get(java.lang.Object extension, java.lang.Object key)
          Getter for a value from an extended section of the context.
 Token getAfterassignment()
          Getter for the after assignment token.
 Tokens getBottomMark(java.lang.Object name)
          Getter for the bottom mark.
 Box getBox(java.lang.String name)
          Getter for the box register.
 Catcode getCatcode(UnicodeChar uc)
          Get the Catcode for a given Unicode character.
 Code getCode(CodeToken t)
          Convenience method to get the code assigned to a Token.
 Conditional getConditional()
          Getter for the currently active conditional.
 Count getCount(java.lang.String name)
          Getter for the count register.
 FixedCount getCountOption(java.lang.String name)
          Getter for a count register.
 MathDelimiter getDelcode(UnicodeChar c)
          Getter for the delimiter code mapping.
 Dimen getDimen(java.lang.String name)
          Get the current value of the dimen register with a given name.
 FixedDimen getDimenOption(java.lang.String name)
          Getter for a dimen register.
 int getErrorCount()
          Getter for the error count.
 Tokens getFirstMark(java.lang.Object name)
          Getter for the first mark.
 Font getFont(java.lang.String name)
          Getter for a current font register.
 CoreFontFactory getFontFactory()
          Getter for the font factory.
 Glue getGlue(java.lang.String name)
          Getter for a glue register.
 FixedGlue getGlueOption(java.lang.String name)
          Getter for a glue register.
protected  Group getGroup()
          Getter for group.
 GroupInfo[] getGroupInfos()
          Getter for the array of group information describing the currently open groups.
 long getGroupLevel()
          Getter for the group level.
 GroupType getGroupType()
          Getter for the group type.
 java.lang.String getId()
          Getter for the id string.
 long getIfLevel()
          Getter for the current if level.
 InFile getInFile(java.lang.String name)
          Getter for a input file register.
 Interaction getInteraction()
          Getter for the interaction.
 Language getLanguage(java.lang.String language)
          Getter for the hyphenation record for a given language.
 LanguageManager getLanguageManager()
          Getter for the language manager.
 UnicodeChar getLccode(UnicodeChar uc)
          Getter for the lccode mapping of upper case characters to their lower case equivalent.
protected  Localizer getLocalizer()
          Getter for localizer.
 long getMagnification()
          Getter for the magnification factor in per mille.
 MathCode getMathcode(UnicodeChar uc)
          Getter for the math code of a character.
 Muskip getMuskip(java.lang.String name)
          Getter for a muskip register.
 java.lang.String getNamespace()
          Getter for the current name space.
 OutFile getOutFile(java.lang.String name)
          Getter for an output file descriptor.
 ParagraphShape getParshape()
          Getter for the parshape.
 FixedCount getSfcode(UnicodeChar uc)
          Getter for the space factor code of a character.
 Tokens getSplitBottomMark(java.lang.Object name)
          Getter for the split bottom mark.
 Tokens getSplitFirstMark(java.lang.Object name)
          Getter for the split first mark.
 TokenStream getStandardTokenStream()
          Getter for standardTokenStream.
 TokenFactory getTokenFactory()
          Getter for the token factory.
 Tokenizer getTokenizer()
          Getter for the tokenizer.
 java.lang.String getTokensOption(java.lang.String name)
          Getter for a token register.
 Tokens getToks(java.lang.String name)
          Getter for the Tokens register.
 FixedTokens getToksOption(java.lang.String name)
          Getter for a tokens register.
 Tokens getToksOrNull(java.lang.String name)
          Getter for the toks register.
 Tokens getTopMark(java.lang.Object name)
          Getter for the top mark.
 TypesettingContext getTypesettingContext()
          Getter for the typesetting context.
 TypesettingContextFactory getTypesettingContextFactory()
          Getter for the typesetting context factory.
 UnicodeChar getUccode(UnicodeChar lc)
          Getter for the uccode mapping of lower case characters to their upper case equivalent.
 int incrementErrorCount()
          Increment the error count by 1.
 boolean isGlobalGroup()
          Test whether this group is the first one, which means that there is no group before and closing this group would fail.
 void openGroup(GroupType type, Locator locator, Token start)
          This method can be used to open another group.
 Conditional popConditional()
          Pop the management information for a conditional from the stack and return it.
 Direction popDirection()
          Pop a direction from the direction stack.
 void pushConditional(Locator locator, boolean isIfThenElse, Code primitive, long branch, boolean neg)
          Put a value onto the conditional stack.
 void pushDirection(Direction dir)
          Push a direction onto the direction stack.
 java.lang.Object readResolve()
          This method maps instances to their normal representations if required.
 void receiveLoad(TokenSource source, Typesetter typesetter)
          Receive a notification about a load event.
 void registerCodeChangeObserver(Token token, CodeObserver observer)
          Register an observer for code change events.
 void registerConditionalObserver(ConditionalObserver observer)
          Register an observer for conditional events.
 void registerCountObserver(java.lang.String name, CountObserver observer)
          Register an observer for count change events.
 void registerDimenObserver(java.lang.String name, DimenObserver observer)
          Register an observer for dimen change events.
 void registerGlueObserver(java.lang.String name, GlueObserver observer)
          Register an observer for glue change events.
 void registerGroupObserver(GroupObserver observer)
          Register an observer for group change events.
 void registerInteractionObserver(InteractionObserver observer)
          Register an observer for interaction mode change events.
 void registerLoadObserver(LoadedObserver observer)
          Register an observer for load events.
 void registerTokensObserver(java.lang.String name, TokensObserver observer)
          Register an observer for tokens change events.
 void set(Color color, boolean global)
          Setter for the color in the current typesetting context.
 void set(Direction direction, boolean global)
          Setter for the direction in the current typesetting context.
 void set(Font font, boolean global)
          Setter for the font in the current typesetting context.
 void set(Language language, boolean global)
          Setter for the language in the current typesetting context.
 void set(java.lang.Object extension, java.lang.Object key, java.lang.Object value, boolean global)
          Setter for a value from an extended section of the context.
 void set(TypesettingContext context, boolean global)
          Setter for the typesetting context in the specified groups.
 void setAfterassignment(Token token)
          Setter for the after assignment token.
 void setBox(java.lang.String name, Box value, boolean global)
          Setter for the box register in the current group.
 void setCatcode(UnicodeChar c, Catcode catcode, boolean global)
          Setter for the catcode of a character in the specified groups.
 void setCode(CodeToken t, Code code, boolean global)
          Setter for the code assigned to a Token.
 void setCount(java.lang.String name, long value, boolean global)
          Setter for the count register in all requested groups.
 void setCountOption(java.lang.String name, long value)
          Setter for a count register.
 void setDelcode(UnicodeChar c, MathDelimiter delimiter, boolean global)
          Setter for the delimiter code mapping.
 void setDimen(java.lang.String name, Dimen value, boolean global)
          Setter for the Dimen register in all requested groups.
 void setDimen(java.lang.String name, long value, boolean global)
          Setter for the Dimen register in all requested groups.
 void setFont(java.lang.String name, Font font, boolean global)
          Setter for font registers.
 void setFontFactory(CoreFontFactory factory)
          Setter for the font factory.
 void setGlue(java.lang.String name, Glue value, boolean global)
          Setter for a glue register.
 void setId(java.lang.String theId)
          Setter for the id string.
 void setInFile(java.lang.String name, InFile file, boolean global)
          Setter for the InFile register in all requested groups.
 void setInteraction(Interaction interaction)
          Setter for the interaction in all requested groups.
 void setLanguageManager(LanguageManager manager)
          Setter for the language manager.
 void setLccode(UnicodeChar uc, UnicodeChar lc, boolean global)
          Declare the translation from an upper case character to a lower case character.
 void setMagnification(long mag, boolean lock)
          Setter for the magnification.
 void setMark(java.lang.Object name, Tokens mark)
          Setter for a mark.
 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 a muskip register.
 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 a output file descriptor.
 void setParshape(ParagraphShape shape)
          Setter for the paragraph shape.
 void setSfcode(UnicodeChar uc, Count code, boolean global)
          Setter for the space factor code in the specified groups.
 void setSplitMark(java.lang.Object name, Tokens mark)
          Setter for a split mark.
 void setStandardTokenStream(TokenStream standardTokenStream)
          Setter for standardTokenStream.
 void setTokenFactory(TokenFactory factory)
          Setter for the token factory
 void setToks(java.lang.String name, Tokens toks, boolean global)
          Setter for the Tokens register 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.
 void startMarks()
          This method indicated that a new page is started.
 java.util.Iterator<UnitInfo> unitIterator()
          Get an iterator to enumerate all unit infos.
 void unregisterCodeChangeObserver(Token name, CodeObserver observer)
          Remove a registered observer for code change events.
 void unregisterConditionalObserver(ConditionalObserver observer)
          Remove a registered observer for conditional events.
 void unregisterCountObserver(java.lang.String name, CountObserver observer)
          Remove a registered observer for count change events.
 void unregisterDimenObserver(java.lang.String name, DimenObserver observer)
          Remove a registered observer for dimen change events.
 void unregisterGlueObserver(java.lang.String name, GlueObserver observer)
          Remove a registered observer for glue change events.
 void unregisterGroupObserver(GroupObserver observer)
          Remove a registered observer for group change events.
 void unregisterInteractionObserver(InteractionObserver observer)
          Remove a registered observer for interaction mode change events.
 void unregisterLoadObserver(LoadedObserver observer)
          Remove a registered observer for load events.
 void unregisterTokensChangeObserver(java.lang.String name, TokensObserver observer)
          Remove a registered observer for tokens change events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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

ContextImpl

public ContextImpl()
Creates a new object.

Method Detail

addUnit

public void addUnit(UnitInfo info)
Add a unit to the list of loaded units. The units can be notified when the context is loaded from a format.

Specified by:
addUnit in interface Context
Parameters:
info - the info of the unit loaded
See Also:
unitIterator(), Context.addUnit( org.extex.interpreter.unit.UnitInfo)

afterGroup

public void afterGroup(AfterGroupObserver observer)
Register a observer to be called at the end of the group. The end of the group is reached when the group is closed.

Specified by:
afterGroup in interface ContextGroup
Parameters:
observer - the observer to register
See Also:
ContextGroup.afterGroup( AfterGroupObserver)

afterGroup

public void afterGroup(Token t)
Add a token to the tokens inserted after the group has been closed.

Specified by:
afterGroup in interface ContextGroup
Parameters:
t - the token to add
See Also:
ContextGroup.afterGroup( org.extex.scanner.type.token.Token)

clearSplitMarks

public void clearSplitMarks()
This method clears all split marks.

Specified by:
clearSplitMarks in interface ContextMark
See Also:
ContextMark.clearSplitMarks()

closeGroup

public void closeGroup(Typesetter typesetter,
                       TokenSource source)
                throws HelpingException
Perform all actions required upon the closing of a group.

Specified by:
closeGroup in interface ContextGroup
Parameters:
typesetter - the typesetter to invoke if needed
source - the source to get Tokens from if needed
Throws:
HelpingException - in case of an error
See Also:
ContextGroup.closeGroup( org.extex.typesetter.Typesetter, org.extex.interpreter.TokenSource)

configure

public void configure(Configuration configuration)
Configure an object according to a given Configuration.

Specified by:
configure in interface Configurable
Parameters:
configuration - the configuration object to consider
Throws:
ConfigurationException - in case that something went wrong
See Also:
Configurable.configure( org.extex.framework.configuration.Configuration)

enableLogging

public void enableLogging(java.util.logging.Logger logger)
Setter for the logger.

Specified by:
enableLogging in interface LogEnabled
Parameters:
logger - the logger to use
See Also:
LogEnabled.enableLogging( java.util.logging.Logger)

esc

public java.lang.String esc(java.lang.String name)
Attach the current escape character in front of a name and return the result. If the escape character is not set then the argument is returned unchanged.

This method is meant to produce a printable version of a control sequence for error messages.

Specified by:
esc in interface Context
Parameters:
name - the name of the macro
Returns:
the control sequence including the escape character
See Also:
Context.esc(java.lang.String)

esc

public java.lang.String esc(Token token)
This method is meant to produce a printable version of a control sequence for error messages.

Specified by:
esc in interface Context
Parameters:
token - the token
Returns:
the control sequence including the escape character
See Also:
Context.esc( org.extex.scanner.type.token.Token)

escapechar

public UnicodeChar escapechar()
Return the current escape character or \0 if it is undefined. The escape character is retrieved from the count register \escapechar.

Specified by:
escapechar in interface Context
Returns:
the escape character
See Also:
Context.escapechar()

get

public java.lang.Object get(java.lang.Object extension,
                            java.lang.Object key)
Description copied from interface: Context
Getter for a value from an extended section of the context.

Specified by:
get in interface Context
Parameters:
extension - the name of the extension
key - the key for the value
Returns:
the value stored
See Also:
Context.get( java.lang.Object, java.lang.Object)

getAfterassignment

public Token getAfterassignment()
Getter for the after assignment token.

Specified by:
getAfterassignment in interface Context
Returns:
the after assignment token
See Also:
Context.getAfterassignment()

getBottomMark

public Tokens getBottomMark(java.lang.Object name)
Getter for the bottom mark.

Specified by:
getBottomMark in interface ContextMark
Parameters:
name - the name of the mark
Returns:
the bottom mark
See Also:
ContextMark.getBottomMark( java.lang.Object)

getBox

public Box getBox(java.lang.String name)
Getter for the box register. Count registers are named, either with a number or an arbitrary string.

Specified by:
getBox in interface Context
Parameters:
name - the name or number of the count register
Returns:
the count register or null if it is void
See Also:
Context.getBox(java.lang.String)

getCatcode

public Catcode getCatcode(UnicodeChar uc)
Get the Catcode for a given Unicode character.

Specified by:
getCatcode in interface Tokenizer
Parameters:
uc - the Unicode character to get the catcode for.
Returns:
the catcode for the character
See Also:
Tokenizer.getCatcode(org.extex.core.UnicodeChar)

getCode

public Code getCode(CodeToken t)
             throws HelpingException
Convenience method to get the code assigned to a Token. If the Token is a ControlSequenceToken then the macro is returned. If the Token is a ActiveCharacterToken then the active value is returned.

Specified by:
getCode in interface ContextCode
Parameters:
t - the Token to differentiate on
Returns:
the code for the token
Throws:
HelpingException - in case of an error
See Also:
ContextCode.getCode( org.extex.scanner.type.token.CodeToken)

getConditional

public Conditional getConditional()
Getter for the currently active conditional.

Specified by:
getConditional in interface Context
Returns:
the currently active conditional or null if none
See Also:
Context.getConditional()

getCount

public Count getCount(java.lang.String name)
Getter for the count register. Count registers are named, either with a number or an arbitrary string.

The return value is guaranteed to be a valid object. null will never be returned.

Specified by:
getCount in interface ContextCount
Parameters:
name - the name or number of the count register
Returns:
the count register or null if it is not defined
See Also:
ContextCount.getCount( java.lang.String)

getCountOption

public FixedCount getCountOption(java.lang.String name)
Getter for a count register.

Specified by:
getCountOption in interface DocumentWriterOptions
Specified by:
getCountOption in interface TokenStreamOptions
Specified by:
getCountOption in interface PageContext
Specified by:
getCountOption in interface TypesetterOptions
Parameters:
name - the name of the register
Returns:
the content of the count register
See Also:
TypesetterOptions.getCountOption( java.lang.String)

getDelcode

public MathDelimiter getDelcode(UnicodeChar c)
Getter for the delimiter code mapping.

Specified by:
getDelcode in interface Context
Parameters:
c - the character to which the delimiter code is assigned
Returns:
the delimiter code for the given character
See Also:
Context.getDelcode( org.extex.core.UnicodeChar)

getDimen

public Dimen getDimen(java.lang.String name)
Get the current value of the dimen register with a given name.

Specified by:
getDimen in interface ContextDimen
Parameters:
name - the name or the number of the register
Returns:
the dimen register for the given name
See Also:
ContextDimen.getDimen( java.lang.String)

getDimenOption

public FixedDimen getDimenOption(java.lang.String name)
Getter for a dimen register.

Specified by:
getDimenOption in interface DocumentWriterOptions
Specified by:
getDimenOption in interface PageContext
Specified by:
getDimenOption in interface TypesetterOptions
Parameters:
name - the name of the register
Returns:
the content of the dimen register
See Also:
TypesetterOptions.getDimenOption( java.lang.String)

getErrorCount

public int getErrorCount()
Description copied from interface: ContextErrorCount
Getter for the error count.

Specified by:
getErrorCount in interface ContextErrorCount
Returns:
the current value of the number of errors
See Also:
ContextErrorCount.getErrorCount()

getFirstMark

public Tokens getFirstMark(java.lang.Object name)
Description copied from interface: ContextMark
Getter for the first mark.

Specified by:
getFirstMark in interface ContextMark
Parameters:
name - the name of the mark
Returns:
the first mark
See Also:
ContextMark.getFirstMark( java.lang.Object)

getFont

public Font getFont(java.lang.String name)
Description copied from interface: ContextFont
Getter for a current font register.

Specified by:
getFont in interface ContextFont
Specified by:
getFont in interface PageContext
Specified by:
getFont in interface TypesetterOptions
Parameters:
name - the name or the number of the register
Returns:
the named font register or null if none is set
See Also:
ContextFont.getFont(java.lang.String)

getFontFactory

public CoreFontFactory getFontFactory()
Description copied from interface: ContextFont
Getter for the font factory.

Specified by:
getFontFactory in interface ContextFont
Returns:
the fontFactory.
See Also:
ContextFont.getFontFactory()

getGlue

public Glue getGlue(java.lang.String name)
Description copied from interface: Context
Getter for a glue register.

Specified by:
getGlue in interface Context
Parameters:
name - the name of the glue register to acquire.
Returns:
the value of the named glue register or null if none is set
See Also:
Context.getGlue(java.lang.String)

getGlueOption

public FixedGlue getGlueOption(java.lang.String name)
Description copied from interface: PageContext
Getter for a glue register.

Specified by:
getGlueOption in interface PageContext
Specified by:
getGlueOption in interface TypesetterOptions
Parameters:
name - the name of the register
Returns:
the content of the glue register
See Also:
TypesetterOptions.getGlueOption(java.lang.String)

getGroup

protected Group getGroup()
Getter for group.

Returns:
the group.

getGroupInfos

public GroupInfo[] getGroupInfos()
Getter for the array of group information describing the currently open groups. The elements represent the groups in ascending order. Thus the element 0 always represents the global group. This one is guaranteed to be present. This means that the arras has always at least one element.

Specified by:
getGroupInfos in interface ContextGroup
Returns:
the array of group infos
See Also:
ContextGroup.getGroupInfos()

getGroupLevel

public long getGroupLevel()
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.

Specified by:
getGroupLevel in interface ContextGroup
Returns:
the group level
See Also:
ContextGroup.getGroupLevel()

getGroupType

public GroupType getGroupType()
Getter for the group type.

Specified by:
getGroupType in interface ContextGroup
Returns:
the group type
See Also:
ContextGroup.getGroupType()

getId

public java.lang.String getId()
Getter for the id string. The id string is the classification of the original source as given in the format file. The id string can be null if not known yet.

Specified by:
getId in interface Context
Returns:
the id string
See Also:
Context.getId()

getIfLevel

public long getIfLevel()
Getter for the current if level.

Specified by:
getIfLevel in interface Context
Returns:
the current if level
See Also:
Context.getIfLevel()

getInFile

public InFile getInFile(java.lang.String name)
Getter for a input file register. In the case that the named descriptor doe not exist yet a new one is returned. Especially if the name is null then the default input stream is used.

Specified by:
getInFile in interface ContextFile
Parameters:
name - the name or the number of the file register
Returns:
the input file descriptor
See Also:
ContextFile.getInFile( java.lang.String)

getInteraction

public Interaction getInteraction()
Getter for the interaction. The interaction determines how verbose the actions are reported and how the interaction with the user is performed in case of an error.

Specified by:
getInteraction in interface ContextInteraction
Returns:
the current interaction
See Also:
ContextInteraction.getInteraction()

getLanguage

public Language getLanguage(java.lang.String language)
                     throws HelpingException
Getter for the hyphenation record for a given language. The language is used to find the hyphenation table. If the language is not known an attempt is made to create it. Otherwise the default hyphenation table is returned.

Specified by:
getLanguage in interface Context
Parameters:
language - the name of the language to use
Returns:
the hyphenation table for the requested language
Throws:
HelpingException - in case of an error
See Also:
Context.getLanguage(String)

getLanguageManager

public LanguageManager getLanguageManager()
Getter for the language manager.

Specified by:
getLanguageManager in interface Context
Returns:
the language manager
See Also:
Context.getLanguageManager()

getLccode

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

Specified by:
getLccode in interface Context
Specified by:
getLccode in interface PageContext
Specified by:
getLccode in interface TypesetterOptions
Parameters:
uc - the upper case character
Returns:
the lower case equivalent or null if none exists
See Also:
Context.getLccode( org.extex.core.UnicodeChar)

getLocalizer

protected Localizer getLocalizer()
Getter for localizer.

Returns:
the localizer.

getMagnification

public long getMagnification()
Getter for the magnification factor in per mille. The default value is 1000. It can only take positive numbers as values.

Specified by:
getMagnification in interface DocumentWriterOptions
Specified by:
getMagnification in interface Context
Returns:
the magnification factor
See Also:
Context.getMagnification()

getMathcode

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

Specified by:
getMathcode in interface Context
Parameters:
uc - the character index
Returns:
the math code
See Also:
Context.getMathcode( org.extex.core.UnicodeChar)

getMuskip

public Muskip getMuskip(java.lang.String name)
Getter for a muskip register.

Specified by:
getMuskip in interface Context
Specified by:
getMuskip in interface PageContext
Specified by:
getMuskip in interface TypesetterOptions
Parameters:
name - the name or the number of the register
Returns:
the named muskip or null if none is set
See Also:
Context.getMuskip( java.lang.String)

getNamespace

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

Specified by:
getNamespace in interface Context
Specified by:
getNamespace in interface Tokenizer
Specified by:
getNamespace in interface PageContext
Specified by:
getNamespace in interface TypesetterOptions
Returns:
the current name space
See Also:
Context.getNamespace()

getOutFile

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

Specified by:
getOutFile in interface ContextFile
Specified by:
getOutFile in interface PageContext
Parameters:
name - the name or the number of the file register
Returns:
the output file descriptor
See Also:
ContextFile.getOutFile( java.lang.String)

getParshape

public ParagraphShape getParshape()
Getter for the parshape. The parshape is a feature of the context which does not interact with the grouping mechanism.

Specified by:
getParshape in interface Context
Specified by:
getParshape in interface PageContext
Specified by:
getParshape in interface TypesetterOptions
Returns:
the paragraph shape or null if no special shape is present
See Also:
Context.getParshape()

getSfcode

public FixedCount getSfcode(UnicodeChar uc)
Getter for the space factor code of a character.

Specified by:
getSfcode in interface Context
Parameters:
uc - the Unicode character
Returns:
the space factor code.
See Also:
Context.getSfcode( org.extex.core.UnicodeChar)

getSplitBottomMark

public Tokens getSplitBottomMark(java.lang.Object name)
Getter for the split bottom mark.

Specified by:
getSplitBottomMark in interface ContextMark
Parameters:
name - the name of the mark
Returns:
the split bottom mark
See Also:
ContextMark.getSplitBottomMark( java.lang.Object)

getSplitFirstMark

public Tokens getSplitFirstMark(java.lang.Object name)
Getter for the split first mark.

Specified by:
getSplitFirstMark in interface ContextMark
Parameters:
name - the name of the mark
Returns:
the split first mark
See Also:
ContextMark.getSplitFirstMark( java.lang.Object)

getStandardTokenStream

public TokenStream getStandardTokenStream()
Getter for standardTokenStream.

Specified by:
getStandardTokenStream in interface Context
Returns:
the standardTokenStream
See Also:
Context.getStandardTokenStream()

getTokenFactory

public TokenFactory getTokenFactory()
Getter for the token factory.

Specified by:
getTokenFactory in interface Context
Specified by:
getTokenFactory in interface PageContext
Specified by:
getTokenFactory in interface TypesetterOptions
Returns:
the token factory
See Also:
Context.setTokenFactory(TokenFactory)

getTokenizer

public Tokenizer getTokenizer()
Getter for the tokenizer.

Specified by:
getTokenizer in interface Context
Returns:
the tokenizer
See Also:
Context.setCatcode(UnicodeChar, Catcode, boolean)

getTokensOption

public java.lang.String getTokensOption(java.lang.String name)
Description copied from interface: DocumentWriterOptions
Getter for a token register.

Specified by:
getTokensOption in interface DocumentWriterOptions
Parameters:
name - the name of the register
Returns:
the content of the token register
See Also:
DocumentWriterOptions.getTokensOption(java.lang.String)

getToks

public Tokens getToks(java.lang.String name)
Description copied from interface: ContextTokens
Getter for the Tokens register. Tokens 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.

Specified by:
getToks in interface ContextTokens
Parameters:
name - the name or number of the token register
Returns:
the token register or a new one if it is not defined yet
See Also:
ContextTokens.getToks(java.lang.String)

getToksOption

public FixedTokens getToksOption(java.lang.String name)
Description copied from interface: TokenStreamOptions
Getter for a tokens register.

Specified by:
getToksOption in interface TokenStreamOptions
Parameters:
name - the name of the register
Returns:
the content of the tokens register
See Also:
TokenStreamOptions.getToksOption( java.lang.String)

getToksOrNull

public Tokens getToksOrNull(java.lang.String name)
Description copied from interface: ContextTokens
Getter for the toks register. Tokens 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.

Specified by:
getToksOrNull in interface ContextTokens
Parameters:
name - the name or number of the token register
Returns:
the token register or null if it is not defined
See Also:
ContextTokens.getToksOrNull(java.lang.String)

getTopMark

public Tokens getTopMark(java.lang.Object name)
Description copied from interface: ContextMark
Getter for the top mark.

Specified by:
getTopMark in interface ContextMark
Parameters:
name - the name of the mark
Returns:
the top mark
See Also:
ContextMark.getTopMark( java.lang.Object)

getTypesettingContext

public TypesettingContext getTypesettingContext()
Getter for the typesetting context.

Specified by:
getTypesettingContext in interface Context
Specified by:
getTypesettingContext in interface PageContext
Specified by:
getTypesettingContext in interface TypesetterOptions
Returns:
the typesetting context
See Also:
TypesetterOptions.getTypesettingContext()

getTypesettingContextFactory

public TypesettingContextFactory getTypesettingContextFactory()
Description copied from interface: ContextInternals
Getter for the typesetting context factory.

Specified by:
getTypesettingContextFactory in interface ContextInternals
Specified by:
getTypesettingContextFactory in interface PageContext
Specified by:
getTypesettingContextFactory in interface TypesetterOptions
Returns:
the typesetting context factory
See Also:
ContextInternals.getTypesettingContextFactory()

getUccode

public UnicodeChar getUccode(UnicodeChar lc)
Description copied from interface: Context
Getter for the uccode mapping of lower case characters to their upper case equivalent.

Specified by:
getUccode in interface Context
Parameters:
lc - the upper case character
Returns:
the upper case equivalent or null if none exists
See Also:
Context.getUccode( org.extex.core.UnicodeChar)

incrementErrorCount

public int incrementErrorCount()
Description copied from interface: ContextErrorCount
Increment the error count by 1.

Specified by:
incrementErrorCount in interface ContextErrorCount
Returns:
the new value of the error count
See Also:
ContextErrorCount.incrementErrorCount()

isGlobalGroup

public boolean isGlobalGroup()
Description copied from interface: ContextGroup
Test whether this group is the first one, which means that there is no group before and closing this group would fail.

Specified by:
isGlobalGroup in interface ContextGroup
Returns:
true iff this is the first group
See Also:
ContextGroup.isGlobalGroup()

openGroup

public void openGroup(GroupType type,
                      Locator locator,
                      Token start)
               throws HelpingException
This method can be used to open another group. The current group is pushed onto the stack to be reactivated when the new group will be closed.

Specified by:
openGroup in interface ContextGroup
Parameters:
type - the type of the group
locator - the locator for the start
start - the token which started the group
Throws:
ConfigurationException - in case of an error in the configuration, e.g. the class for the group can not be determined.
HelpingException - in case of an error
See Also:
closeGroup(Typesetter, TokenSource), ContextGroup.openGroup( org.extex.interpreter.context.group.GroupType, org.extex.core.Locator, org.extex.scanner.type.token.Token)

popConditional

public Conditional popConditional()
                           throws HelpingException
Pop the management information for a conditional from the stack and return it. If the stack is empty then null is returned.

Specified by:
popConditional in interface Context
Returns:
the formerly topmost element from the conditional stack
Throws:
HelpingException - in case of an error
See Also:
Context.popConditional()

popDirection

public Direction popDirection()
Pop a direction from the direction stack.

Specified by:
popDirection in interface Context
Returns:
the topmost direction on the stack or null if the stack is empty
See Also:
Context.popDirection()

pushConditional

public void pushConditional(Locator locator,
                            boolean isIfThenElse,
                            Code primitive,
                            long branch,
                            boolean neg)
Put a value onto the conditional stack.

Specified by:
pushConditional in interface Context
Parameters:
locator - the locator for the start of the if statement
isIfThenElse - the value to push
primitive - the name of the primitive which triggered this operation
branch - the branch number
neg - negation indicator
See Also:
Context.pushConditional( org.extex.core.Locator, boolean, org.extex.interpreter.type.Code, long, boolean)

pushDirection

public void pushDirection(Direction dir)
Push a direction onto the direction stack.

Specified by:
pushDirection in interface Context
Parameters:
dir - the direction
See Also:
Context.pushDirection( org.extex.typesetter.tc.Direction)

readResolve

public java.lang.Object readResolve()
                             throws java.io.ObjectStreamException
This method maps instances to their normal representations if required. It is used during the deserialization.

Returns:
the normalized object
Throws:
java.io.ObjectStreamException - in case of an error

receiveLoad

public void receiveLoad(TokenSource source,
                        Typesetter typesetter)
                 throws HelpingException
Receive a notification about a load event.

Specified by:
receiveLoad in interface LoadedObservable
Parameters:
source - the token source
typesetter - the typesetter
Throws:
HelpingException - in case of an error
See Also:
LoadedObservable.receiveLoad( org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)

registerCodeChangeObserver

public void registerCodeChangeObserver(Token token,
                                       CodeObserver observer)
Register an observer for code change events. Code change events are triggered when the assignment of a macro or active character changes. In this case the appropriate method in the observer is invoked.

Specified by:
registerCodeChangeObserver in interface CodeObservable
Parameters:
token - the token to be observed. This should be a macro or active character token.
observer - the observer to receive the events
See Also:
CodeObservable.registerCodeChangeObserver( org.extex.scanner.type.token.Token, org.extex.interpreter.context.observer.code.CodeObserver)

registerConditionalObserver

public void registerConditionalObserver(ConditionalObserver observer)
Register an observer for conditional events. Conditional events are triggered when a conditional is started or ended.

Specified by:
registerConditionalObserver in interface ConditionalObservable
Parameters:
observer - the observer to receive the events
See Also:
ConditionalObservable.registerConditionalObserver( org.extex.interpreter.context.observer.conditional.ConditionalObserver)

registerCountObserver

public void registerCountObserver(java.lang.String name,
                                  CountObserver observer)
Register an observer for count change events. Count change events are triggered when a value is assigned to a count register. In this case the appropriate method in the observer is invoked.

A single count register can be observed by giving a name of the count register to observe. Only changes to this register trigger the notification. If this name is null the changes to all registers are reported to the observer.

Specified by:
registerCountObserver in interface CountObservable
Parameters:
name - the name or the number of the register
observer - the observer to receive the events
See Also:
CountObservable.registerCountObserver( java.lang.String, org.extex.interpreter.context.observer.count.CountObserver)

registerDimenObserver

public void registerDimenObserver(java.lang.String name,
                                  DimenObserver observer)
Register an observer for dimen change events. Count change events are triggered when a value is assigned to a dimen register. In this case the appropriate method in the observer is invoked.

A single dimen register can be observed by giving a name of the dimen register to observe. Only changes to this register trigger the notification. If this name is null the changes to all registers are reported to the observer.

Specified by:
registerDimenObserver in interface DimenObservable
Parameters:
name - the name or the number of the register
observer - the observer to receive the events
See Also:
DimenObservable.registerDimenObserver( java.lang.String, org.extex.interpreter.context.observer.dimen.DimenObserver)

registerGlueObserver

public void registerGlueObserver(java.lang.String name,
                                 GlueObserver observer)
Register an observer for glue change events. Count change events are triggered when a value is assigned to a glue register. In this case the appropriate method in the observer is invoked.

A single glue register can be observed by giving a name of the glue register to observe. Only changes to this register trigger the notification. If this name is null the changes to all registers are reported to the observer.

Specified by:
registerGlueObserver in interface GlueObservable
Parameters:
name - the name or the number of the register
observer - the observer to receive the events
See Also:
GlueObservable.registerGlueObserver( java.lang.String, org.extex.interpreter.context.observer.glue.GlueObserver)

registerGroupObserver

public void registerGroupObserver(GroupObserver observer)
Register an observer for group change events. Group change events are triggered when a group is opened or closed. In this case the appropriate method in the observer is invoked.

Specified by:
registerGroupObserver in interface GroupObservable
Parameters:
observer - the observer to receive the events
See Also:
GroupObservable.registerGroupObserver( org.extex.interpreter.context.observer.group.GroupObserver)

registerInteractionObserver

public void registerInteractionObserver(InteractionObserver observer)
Register an observer for interaction mode change events. Interaction mode change events are triggered when a new value is assigned to the interaction mode. In this case the appropriate method in the observer is invoked.

A single count register can be observed by giving a name of the count register to observe. Only changes to this register trigger the notification. If this name is null the changes to all registers are reported to the observer.

Specified by:
registerInteractionObserver in interface InteractionObservable
Parameters:
observer - the observer to receive the events
See Also:
InteractionObservable.registerInteractionObserver( org.extex.interpreter.context.observer.interaction.InteractionObserver)

registerLoadObserver

public void registerLoadObserver(LoadedObserver observer)
Register an observer for load events. Code change events are triggered when the context is loaded.

Specified by:
registerLoadObserver in interface LoadedObservable
Parameters:
observer - the observer to receive the events
See Also:
LoadedObservable.registerLoadObserver( org.extex.interpreter.context.observer.load.LoadedObserver)

registerTokensObserver

public void registerTokensObserver(java.lang.String name,
                                   TokensObserver observer)
Register an observer for tokens change events. Tokens change events are triggered when an assignment to a tokens register is performed. In this case the appropriate method in the observer is invoked.

Specified by:
registerTokensObserver in interface TokensObservable
Parameters:
name - the token to be observed. This should be a macro or active character token.
observer - the observer to receive the events
See Also:
TokensObservable.registerTokensObserver( java.lang.String, org.extex.interpreter.context.observer.tokens.TokensObserver)

set

public void set(Color color,
                boolean global)
         throws ConfigurationException
Setter for the color in the current typesetting context.

Specified by:
set in interface Context
Parameters:
color - the new color
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
Throws:
ConfigurationException - in case of an error in the configuration.
See Also:
Context.set( org.extex.color.Color, boolean)

set

public void set(Direction direction,
                boolean global)
         throws ConfigurationException
Setter for the direction in the current typesetting context.

Specified by:
set in interface Context
Parameters:
direction - the new direction
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
Throws:
ConfigurationException - in case of an error in the configuration.
See Also:
Context.set( org.extex.typesetter.tc.Direction, boolean)

set

public void set(Font font,
                boolean global)
         throws ConfigurationException
Setter for the font in the current typesetting context.

Specified by:
set in interface Context
Parameters:
font - the new font
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
Throws:
ConfigurationException - in case of an error in the configuration.
See Also:
Context.set( org.extex.typesetter.tc.font.Font, boolean)

set

public void set(Language language,
                boolean global)
         throws ConfigurationException
Setter for the language in the current typesetting context.

Specified by:
set in interface Context
Parameters:
language - the new language
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
Throws:
ConfigurationException - in case of an error in the configuration.
See Also:
Context.set( org.extex.language.Language, boolean)

set

public void set(java.lang.Object extension,
                java.lang.Object key,
                java.lang.Object value,
                boolean global)
Setter for a value from an extended section of the context.

Specified by:
set in interface Context
Parameters:
extension - the name of the extension
key - the key for the value
value - the value to store
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
See Also:
Context.set( java.lang.Object, java.lang.Object, java.lang.Object, boolean)

set

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

Specified by:
set in interface Context
Parameters:
context - the new context to use
global - if true then the new value is set in all groups, otherwise only in the current group.
See Also:
Context.getTypesettingContext()

setAfterassignment

public void setAfterassignment(Token token)
Setter for the after assignment token.

Specified by:
setAfterassignment in interface Context
Parameters:
token - the after assignment token
See Also:
Context.setAfterassignment( org.extex.scanner.type.token.Token)

setBox

public void setBox(java.lang.String name,
                   Box value,
                   boolean global)
Setter for the box register in the current group. 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.

Specified by:
setBox in interface Context
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
See Also:
Context.setBox( java.lang.String, org.extex.interpreter.type.box.Box, boolean)

setCatcode

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

Specified by:
setCatcode in interface Context
Parameters:
c - the character to assign a catcode for
catcode - the catcode of the character
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
See Also:
Context.setCatcode( org.extex.core.UnicodeChar, org.extex.scanner.type.Catcode, boolean)

setCode

public void setCode(CodeToken t,
                    Code code,
                    boolean global)
             throws HelpingException
Setter for the code assigned to a Token. The Token has to be either a ActiveCharacterToken or a ControlSequenceToken.

Specified by:
setCode in interface ContextCode
Parameters:
t - the Token to set the code for
code - the code for the token
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
Throws:
HelpingException - in case of an error
See Also:
ContextCode.setCode( org.extex.scanner.type.token.CodeToken, org.extex.interpreter.type.Code, boolean)

setCount

public void setCount(java.lang.String name,
                     long value,
                     boolean global)
              throws HelpingException
Setter for the count 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.

Specified by:
setCount in interface ContextCount
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
Throws:
HelpingException - in case of an error
See Also:
ContextCount.setCount( java.lang.String, long, boolean)

setCountOption

public void setCountOption(java.lang.String name,
                           long value)
                    throws GeneralException
Setter for a count register.

Specified by:
setCountOption in interface PageContext
Specified by:
setCountOption in interface TypesetterOptions
Parameters:
name - the name of the register
value - the value
Throws:
GeneralException - in case of an error
See Also:
TypesetterOptions.setCountOption( java.lang.String, long)

setDelcode

public void setDelcode(UnicodeChar c,
                       MathDelimiter delimiter,
                       boolean global)
Setter for the delimiter code mapping.

Specified by:
setDelcode in interface Context
Parameters:
c - the character to which the delimiter code is assigned
delimiter - the delimiter code
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
See Also:
Context.setDelcode( org.extex.core.UnicodeChar, org.extex.typesetter.type.math.MathDelimiter, boolean)

setDimen

public void setDimen(java.lang.String name,
                     Dimen value,
                     boolean global)
              throws HelpingException
Setter for the Dimen register in all requested groups. Dimen 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.

Specified by:
setDimen in interface ContextDimen
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
Throws:
HelpingException - in case of problems in an observer
See Also:
ContextDimen.setDimen( java.lang.String, org.extex.core.dimen.Dimen, boolean)

setDimen

public void setDimen(java.lang.String name,
                     long value,
                     boolean global)
              throws HelpingException
Setter for the Dimen register in all requested groups. Dimen 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.

Specified by:
setDimen in interface ContextDimen
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
Throws:
HelpingException - in case of problems in an observer
See Also:
ContextDimen.setDimen( java.lang.String, long, boolean)

setFont

public void setFont(java.lang.String name,
                    Font font,
                    boolean global)
Setter for font registers.

Specified by:
setFont in interface ContextFont
Parameters:
name - the name or the number of the register
font - the new Font value
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
See Also:
ContextFont.setFont( java.lang.String, org.extex.typesetter.tc.font.Font, boolean)

setFontFactory

public void setFontFactory(CoreFontFactory factory)
Setter for the font factory.

Specified by:
setFontFactory in interface ContextFont
Parameters:
factory - the font factory to set.
See Also:
ContextFont.setFontFactory( org.extex.font.CoreFontFactory)

setGlue

public void setGlue(java.lang.String name,
                    Glue value,
                    boolean global)
             throws HelpingException
Setter for a glue register.

Specified by:
setGlue in interface Context
Parameters:
name - the name of the glue register
value - the glue value to set
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
Throws:
HelpingException - in case of an error
See Also:
Context.setGlue( java.lang.String, org.extex.core.glue.Glue, boolean)

setId

public void setId(java.lang.String theId)
Setter for the id string. The id string is the classification of the original source like given in the format file.

Specified by:
setId in interface Context
Parameters:
theId - the id string
See Also:
Context.setId(java.lang.String)

setInFile

public void setInFile(java.lang.String name,
                      InFile file,
                      boolean global)
Setter for the InFile register in all requested groups. InFile registers are named, either with a number or an arbitrary string. The numbered registers where limited to 16 in TeX. This restriction does no longer hold for ExTeX.

Specified by:
setInFile in interface ContextFile
Parameters:
name - the name or the number of the file register
file - the input file descriptor
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
See Also:
ContextFile.setInFile( java.lang.String, org.extex.scanner.type.file.InFile, boolean)

setInteraction

public void setInteraction(Interaction interaction)
                    throws HelpingException
Setter for the interaction in all requested groups. The interaction determines how verbose the actions are reported and how the interaction with the user is performed in case of an error.

Specified by:
setInteraction in interface ContextInteraction
Parameters:
interaction - the new value of the interaction
Throws:
HelpingException - in case of an error
See Also:
ContextInteraction.setInteraction( org.extex.interpreter.interaction.Interaction)

setLanguageManager

public void setLanguageManager(LanguageManager manager)
                        throws ConfigurationException
Setter for the language manager.

Specified by:
setLanguageManager in interface Context
Specified by:
setLanguageManager in interface LanguageManagerCarrier
Parameters:
manager - the language manager to carry
Throws:
ConfigurationException - in case of an configuration error
See Also:
LanguageManagerCarrier.setLanguageManager( org.extex.language.LanguageManager)

setLccode

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

Specified by:
setLccode in interface Context
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
See Also:
Context.setLccode( org.extex.core.UnicodeChar, org.extex.core.UnicodeChar, boolean)

setMagnification

public void setMagnification(long mag,
                             boolean lock)
                      throws HelpingException
Setter for the magnification. The magnification is a global value which can be assigned at most once. It contains the magnification factor in permille. The default value is 1000. It can only take positive numbers as values. The maximal value is taken from the configuration option maximalMaginification. The default value for the maximal magnification is 32768.

Specified by:
setMagnification in interface Context
Parameters:
mag - the new magnification factor
lock - lock the new value. Thus it can not be alterd afterwards.
Throws:
HelpingException - in case that the magnification factor is not in the allowed range or that the magnification has been set to a different value earlier.
See Also:
Context.setMagnification(long, boolean)

setMark

public void setMark(java.lang.Object name,
                    Tokens mark)
Setter for a mark. The information for first mark and top mark are updated if necessary.

Specified by:
setMark in interface ContextMark
Specified by:
setMark in interface PageContext
Parameters:
name - the name of the mark
mark - the vale of the mark
See Also:
ContextMark.setMark( java.lang.Object, org.extex.scanner.type.tokens.Tokens)

setMathcode

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

Specified by:
setMathcode in interface Context
Parameters:
uc - the character index
code - the new math code
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
See Also:
Context.setMathcode( org.extex.core.UnicodeChar, MathCode, boolean)

setMuskip

public void setMuskip(java.lang.String name,
                      Muskip value,
                      boolean global)
Setter for a muskip register.

Specified by:
setMuskip in interface Context
Parameters:
name - the name or the number of the register
value - the new value
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
See Also:
Context.setMuskip( java.lang.String, org.extex.core.muskip.Muskip, boolean)

setNamespace

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

Specified by:
setNamespace in interface Context
Parameters:
namespace - the new name space
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
See Also:
Context.setNamespace( java.lang.String, boolean)

setOutFile

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

Specified by:
setOutFile in interface ContextFile
Specified by:
setOutFile in interface PageContext
Parameters:
name - the name or the number of the file register
file - the descriptor of the output file
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
See Also:
ContextFile.setOutFile( java.lang.String, org.extex.scanner.type.file.OutFile, boolean)

setParshape

public void setParshape(ParagraphShape shape)
Setter for the paragraph shape.

Specified by:
setParshape in interface Context
Specified by:
setParshape in interface PageContext
Specified by:
setParshape in interface TypesetterOptions
Parameters:
shape - the new paragraph shape
See Also:
Context.setParshape( org.extex.typesetter.paragraphBuilder.ParagraphShape)

setSfcode

public void setSfcode(UnicodeChar uc,
                      Count code,
                      boolean global)
Setter for the space factor code in the specified groups. Any character has an associated space factor. This value can be set with the current method.

Specified by:
setSfcode in interface Context
Parameters:
uc - the Unicode character to assign the sfcode to
code - the new sfcode
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
See Also:
Context.setSfcode( org.extex.core.UnicodeChar, org.extex.core.count.Count, boolean)

setSplitMark

public void setSplitMark(java.lang.Object name,
                         Tokens mark)
Setter for a split mark. The information for first mark and top mark are updated is necessary.

Specified by:
setSplitMark in interface ContextMark
Parameters:
name - the name of the mark
mark - the vale of the mark
See Also:
ContextMark.setSplitMark( java.lang.Object, org.extex.scanner.type.tokens.Tokens)

setStandardTokenStream

public void setStandardTokenStream(TokenStream standardTokenStream)
Setter for standardTokenStream.

Specified by:
setStandardTokenStream in interface Context
Parameters:
standardTokenStream - the standardTokenStream to set.
See Also:
Context.setStandardTokenStream( org.extex.scanner.api.TokenStream)

setTokenFactory

public void setTokenFactory(TokenFactory factory)
Setter for the token factory

Specified by:
setTokenFactory in interface Context
Parameters:
factory - the new value of the factory
See Also:
Context.setTokenFactory( org.extex.scanner.type.token.TokenFactory)

setToks

public void setToks(java.lang.String name,
                    Tokens toks,
                    boolean global)
             throws HelpingException
Setter for the Tokens register in the specified groups. Tokens 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.

Specified by:
setToks in interface ContextTokens
Parameters:
name - the name or the number of the register
toks - the new value of the register
global - the indicator for the scope; true means all groups; otherwise the current group is affected only
Throws:
HelpingException - in case of a problem in an observer
See Also:
ContextTokens.setToks(java.lang.String, org.extex.scanner.type.tokens.Tokens, boolean)

setUccode

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

Specified by:
setUccode in interface Context
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
See Also:
Context.setUccode( org.extex.core.UnicodeChar, org.extex.core.UnicodeChar, boolean)

startMarks

public void startMarks()
This method indicated that a new page is started. The values of first mark, bottom mark, and top mark should be updated properly.

Specified by:
startMarks in interface ContextMark
See Also:
ContextMark.startMarks()

unitIterator

public java.util.Iterator<UnitInfo> unitIterator()
Get an iterator to enumerate all unit infos.

Specified by:
unitIterator in interface Context
Returns:
the iterator for unit infos
See Also:
Context.unitIterator()

unregisterCodeChangeObserver

public void unregisterCodeChangeObserver(Token name,
                                         CodeObserver observer)
Remove a registered observer for code change events. Code change events are triggered when the assignment of a macro or active character changes. In this case the appropriate method in the observer is invoked.

Specified by:
unregisterCodeChangeObserver in interface CodeObservable
Parameters:
name - the token to be observed. This should be a macro or active character token.
observer - the observer to receive the events
See Also:
CodeObservable.unregisterCodeChangeObserver( org.extex.scanner.type.token.Token, org.extex.interpreter.context.observer.code.CodeObserver)

unregisterConditionalObserver

public void unregisterConditionalObserver(ConditionalObserver observer)
Remove a registered observer for conditional events. Conditional events are triggered when a conditional is started or ended.

Specified by:
unregisterConditionalObserver in interface ConditionalObservable
Parameters:
observer - the observer to receive the events
See Also:
ConditionalObservable.unregisterConditionalObserver( org.extex.interpreter.context.observer.conditional.ConditionalObserver)

unregisterCountObserver

public void unregisterCountObserver(java.lang.String name,
                                    CountObserver observer)
Remove a registered observer for count change events. Count change events are triggered when a value is assigned to a count register. In this case the appropriate method in the observer is invoked.

A single count register can be observed by giving a name of the count register to observe. The de-registration removes all instances of the observer for this register. If none is registered then nothing happens.

If this name is null then the observer for all registers is removed. Note that the observers for named registers are not effected. They have to be unregistered individually.

Specified by:
unregisterCountObserver in interface CountObservable
Parameters:
name - the name or the number of the register
observer - the observer to receive the events
See Also:
CountObservable.unregisterCountObserver( java.lang.String, org.extex.interpreter.context.observer.count.CountObserver)

unregisterDimenObserver

public void unregisterDimenObserver(java.lang.String name,
                                    DimenObserver observer)
Remove a registered observer for dimen change events. Count change events are triggered when a value is assigned to a dimen register. In this case the appropriate method in the observer is invoked.

A single dimen register can be observed by giving a name of the dimen register to observe. The de-registration removes all instances of the observer for this register. If none is registered then nothing happens.

If this name is null then the observer for all registers is removed. Note that the observers for named registers are not effected. They have to be unregistered individually.

Specified by:
unregisterDimenObserver in interface DimenObservable
Parameters:
name - the name or the number of the register
observer - the observer to receive the events
See Also:
DimenObservable.unregisterDimenObserver( java.lang.String, org.extex.interpreter.context.observer.dimen.DimenObserver)

unregisterGlueObserver

public void unregisterGlueObserver(java.lang.String name,
                                   GlueObserver observer)
Remove a registered observer for glue change events. Count change events are triggered when a value is assigned to a glue register. In this case the appropriate method in the observer is invoked.

A single glue register can be observed by giving a name of the glue register to observe. The de-registration removes all instances of the observer for this register. If none is registered then nothing happens.

If this name is null then the observer for all registers is removed. Note that the observers for named registers are not effected. They have to be unregistered individually.

Specified by:
unregisterGlueObserver in interface GlueObservable
Parameters:
name - the name or the number of the register
observer - the observer to receive the events
See Also:
GlueObservable.unregisterGlueObserver( java.lang.String, org.extex.interpreter.context.observer.glue.GlueObserver)

unregisterGroupObserver

public void unregisterGroupObserver(GroupObserver observer)
Remove a registered observer for group change events. Group change events are triggered when a group is opened or closed. In this case the appropriate method in the observer is invoked.

Specified by:
unregisterGroupObserver in interface GroupObservable
Parameters:
observer - the observer to receive the events
See Also:
GroupObservable.unregisterGroupObserver( org.extex.interpreter.context.observer.group.GroupObserver)

unregisterInteractionObserver

public void unregisterInteractionObserver(InteractionObserver observer)
Remove a registered observer for interaction mode change events. Interaction mode change events are triggered when a new value is assigned to the interaction mode. In this case the appropriate method in the observer is invoked.

Specified by:
unregisterInteractionObserver in interface InteractionObservable
Parameters:
observer - the observer to receive the events
See Also:
InteractionObservable.unregisterInteractionObserver( org.extex.interpreter.context.observer.interaction.InteractionObserver)

unregisterLoadObserver

public void unregisterLoadObserver(LoadedObserver observer)
Remove a registered observer for load events. Code change events are triggered when the context is loaded.

Specified by:
unregisterLoadObserver in interface LoadedObservable
Parameters:
observer - the observer to receive the events
See Also:
LoadedObservable.unregisterLoadObserver( org.extex.interpreter.context.observer.load.LoadedObserver)

unregisterTokensChangeObserver

public void unregisterTokensChangeObserver(java.lang.String name,
                                           TokensObserver observer)
Remove a registered observer for tokens change events. Tokens change events are triggered when an assignment to a tokens register is performed. In this case the appropriate method in the observer is invoked.

Specified by:
unregisterTokensChangeObserver in interface TokensObservable
Parameters:
name - the token to be observed. This should be a macro or active character token.
observer - the observer to receive the events
See Also:
TokensObservable.unregisterTokensChangeObserver( java.lang.String, org.extex.interpreter.context.observer.tokens.TokensObserver)