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

public abstract Class UserDefinedCommandOrEnvironment

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.UserDefinedEnvironment, uk.ac.ed.ph.snuggletex.definitions.UserDefinedCommand

Partial base class for UserDefinedCommands and UserDefinedEnvironments.
Author
David McKain
Version
$Revision$
See Also
UserDefinedEnvironment

Field Summary

Modifier and TypeField and Description
protected final int
argumentCount

Number of arguments

protected final String
optionalArgument

Optional argument, which may be blank.

protected final String

Constructor Summary

AccessConstructor and Description
public
UserDefinedCommandOrEnvironment(final String texName, final String optionalArgument, final int argumentCount)

Method Summary

Modifier and TypeMethod and Description
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 LaTeXMode
getArgumentMode(int argumentIndex)

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

User-defined commands and environments stay in the same mode when parsing arguments.

public String
public String
getTeXName()

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

Returns the TeX name for this command or environment.

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

argumentCountback to summary
protected final int argumentCount

Number of arguments

optionalArgumentback to summary
protected final String optionalArgument

Optional argument, which may be blank. null if not supported

texNameback to summary
protected final String texName

Constructor Detail

UserDefinedCommandOrEnvironmentback to summary
public UserDefinedCommandOrEnvironment(final String texName, final String optionalArgument, final int argumentCount)

Method Detail

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.

getArgumentModeback to summary
public LaTeXMode getArgumentMode(int argumentIndex)

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

User-defined commands and environments stay in the same mode when parsing arguments.

getOptionalArgumentback to summary
public String getOptionalArgument()
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.)

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