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

pack-priv abstract Class BuiltinCommandOrEnvironment<H>

extends Object
implements CommandOrEnvironment
Class Inheritance
All Implemented Interfaces
uk.ac.ed.ph.snuggletex.definitions.CommandOrEnvironment
Known Direct Subclasses
uk.ac.ed.ph.snuggletex.definitions.BuiltinEnvironment, uk.ac.ed.ph.snuggletex.definitions.BuiltinCommand
Type Parameters
<H>
type of "handler" used to generate DOM subtrees.
Imports
uk.ac.ed.ph.snuggletex.internal.util.ConstraintUtilities, uk.ac.ed.ph.snuggletex.semantics.Interpretation, .InterpretationType, java.util.EnumMap, .EnumSet

Partial base class for BuiltinCommand and BuiltinEnvironment.
Author
David McKain
Version
$Revision$

Field Summary

Modifier and TypeField and Description
protected final EnumSet<LaTeXMode>
protected final boolean
protected final int
protected final H
protected final EnumMap<InterpretationType, Interpretation>
protected final String
protected final TextFlowContext

Constructor Summary

AccessConstructor and Description
protected
BuiltinCommandOrEnvironment(final String texName, final boolean allowingOptionalArgument, final int argumentCount, final EnumSet<LaTeXMode> allowedModes, final EnumMap<InterpretationType, Interpretation> interpretationMap, final TextFlowContext textFlowContext, final H domBuildingHandler)

Method Summary

Modifier and TypeMethod and Description
public EnumSet<LaTeXMode>
public int
getArgumentCount()

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

Returns the number of mandatory arguments this command expects, which will be zero or greater.

public H
public Interpretation
public EnumMap<InterpretationType, Interpretation>
public String
getTeXName()

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

Returns the TeX name for this command or environment.

public TextFlowContext
public boolean
public boolean
isAllowingOptionalArgument()

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

Returns whether this command/environment takes an optional argument.

public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

allowedModesback to summary
protected final EnumSet<LaTeXMode> allowedModes
allowingOptionalArgumentback to summary
protected final boolean allowingOptionalArgument
argumentCountback to summary
protected final int argumentCount
domBuildingHandlerback to summary
protected final H domBuildingHandler
interpretationMapback to summary
protected final EnumMap<InterpretationType, Interpretation> interpretationMap
texNameback to summary
protected final String texName
textFlowContextback to summary
protected final TextFlowContext textFlowContext

Constructor Detail

BuiltinCommandOrEnvironmentback to summary
protected BuiltinCommandOrEnvironment(final String texName, final boolean allowingOptionalArgument, final int argumentCount, final EnumSet<LaTeXMode> allowedModes, final EnumMap<InterpretationType, Interpretation> interpretationMap, final TextFlowContext textFlowContext, final H domBuildingHandler)

Method Detail

getAllowedModesback to summary
public EnumSet<LaTeXMode> getAllowedModes()
getArgumentCountback to summary
public int getArgumentCount()

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

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

Returns the number of mandatory arguments this command expects, which will be zero or greater.

getDOMBuildingHandlerback to summary
public H getDOMBuildingHandler()
getInterpretationback to summary
public Interpretation getInterpretation(InterpretationType type)
getInterpretationMapback to summary
public EnumMap<InterpretationType, Interpretation> getInterpretationMap()
getTeXNameback to summary
public String getTeXName()

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

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

Returns the TeX name for this command or environment. (In the case of commands, this does not include the leading backslash.)

getTextFlowContextback to summary
public TextFlowContext getTextFlowContext()
hasInterpretationback to summary
public boolean hasInterpretation(InterpretationType type)
isAllowingOptionalArgumentback to summary
public boolean isAllowingOptionalArgument()

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

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

Returns whether this command/environment takes an optional argument. As per LaTeX convention, this will only return true if the command/environment takes at least one mandatory argument as well.

toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override