Top Description Fields Constructors Methods
uk.ac.ed.ph.snuggletex.definitions

public final Class BuiltinCommand

extends BuiltinCommandOrEnvironment<CommandHandler>
implements Command
Class Inheritance
All Implemented Interfaces
uk.ac.ed.ph.snuggletex.definitions.Command, uk.ac.ed.ph.snuggletex.definitions.CommandOrEnvironment
Imports
uk.ac.ed.ph.snuggletex.SnugglePackage, uk.ac.ed.ph.snuggletex.dombuilding.CommandHandler, uk.ac.ed.ph.snuggletex.semantics.Interpretation, .InterpretationType, .MathCharacterInterpretation, java.util.EnumMap, .EnumSet

Represents a Command that has been defined internally via a SnugglePackage.

All of the core LaTeX macros have been defined in this way - see CorePackageDefinitions.

Author
David McKain
Version
$Revision:179 $
See Also
BuiltinEnvironment, CorePackageDefinitions

Field Summary

Modifier and TypeField and Description
private final LaTeXMode[]
argumentModes

Mode to use when parsing arguments.

private final CombinerTargetMatcher
private final CommandType
Inherited from uk.ac.ed.ph.snuggletex.definitions.BuiltinCommandOrEnvironment:
allowedModesallowingOptionalArgumentargumentCountdomBuildingHandlerinterpretationMaptexNametextFlowContext

Constructor Summary

AccessConstructor and Description
public
BuiltinCommand(final String texName, final CommandType commandType, final boolean allowingOptionalArgument, final int argumentCount, final EnumSet<LaTeXMode> allowedModes, final LaTeXMode[] argumentModes, final EnumMap<InterpretationType, Interpretation> interpretations, final CommandHandler domBuilderHandler, final TextFlowContext textFlowContext, final CombinerTargetMatcher combinerTargetMatcher)

Method Summary

Modifier and TypeMethod and Description
public LaTeXMode
getArgumentMode(int argumentIndex)

Implements uk.ac.ed.ph.snuggletex.definitions.CommandOrEnvironment.getArgumentMode.

Returns the LaTeX mode that each argument should be parsed in, starting with the optional argument (if used) and then each mandatory argument in order.

public CombinerTargetMatcher
public MathCharacter
public int
public CommandType
Inherited from uk.ac.ed.ph.snuggletex.definitions.BuiltinCommandOrEnvironment:
getAllowedModesgetArgumentCountgetDOMBuildingHandlergetInterpretationgetInterpretationMapgetTeXNamegetTextFlowContexthasInterpretationisAllowingOptionalArgumenttoString

Field Detail

argumentModesback to summary
private final LaTeXMode[] argumentModes

Mode to use when parsing arguments. If not supplied, will preserve mode that Macro is being used in. (Main example: \mbox{...} will go into LR mode for its arguments)

combinerTargetMatcherback to summary
private final CombinerTargetMatcher combinerTargetMatcher
typeback to summary
private final CommandType type

Constructor Detail

BuiltinCommandback to summary
public BuiltinCommand(final String texName, final CommandType commandType, final boolean allowingOptionalArgument, final int argumentCount, final EnumSet<LaTeXMode> allowedModes, final LaTeXMode[] argumentModes, final EnumMap<InterpretationType, Interpretation> interpretations, final CommandHandler domBuilderHandler, final TextFlowContext textFlowContext, final CombinerTargetMatcher combinerTargetMatcher)

Method Detail

getArgumentModeback to summary
public LaTeXMode getArgumentMode(int argumentIndex)

Implements uk.ac.ed.ph.snuggletex.definitions.CommandOrEnvironment.getArgumentMode.

Doc from uk.ac.ed.ph.snuggletex.definitions.CommandOrEnvironment.getArgumentMode.

Returns the LaTeX mode that each argument should be parsed in, starting with the optional argument (if used) and then each mandatory argument in order. Null entries indicate that the current LaTeX mode should be used.

getCombinerTargetMatcherback to summary
public CombinerTargetMatcher getCombinerTargetMatcher()
getMathCharacterback to summary
public MathCharacter getMathCharacter()
getMathCharacterCodePointback to summary
public int getMathCharacterCodePoint()
getTypeback to summary
public CommandType getType()