org.pz.platypus.interfaces
Interface ICommand

All Known Implementing Classes:
Command, Command0, CommandR, CommandS, CommandV, FontFamily, Symbol

public interface ICommand

Interface for individual commands as stored in the command look-up table.


Method Summary
 ParamType getParamType()
          what kind of argument, if any, does the command take?
 java.lang.String getRoot()
          get the root of the command.
 java.lang.String getRootSubstitute()
          get a substitute string for the root.
 boolean isAllowedInCode()
          Is this command processed or ignored in a code listing?
 int process(GDD gdd, ParseContext context, TokenList tokens, boolean inCode)
          method for processing this command.
 

Method Detail

getRoot

java.lang.String getRoot()
get the root of the command. For example, fsize: in [fsize:12pt]

Returns:
the root as a string

getRootSubstitute

java.lang.String getRootSubstitute()
get a substitute string for the root. This is null except in cases where the command is shorthand for a longer command string.

Returns:
the actual command string for which the current command is shorthand

getParamType

ParamType getParamType()
what kind of argument, if any, does the command take?

Returns:
ParamType for the command

isAllowedInCode

boolean isAllowedInCode()
Is this command processed or ignored in a code listing?

Returns:
boolean indicating whether command is/is not processed in a code listing

process

int process(GDD gdd,
            ParseContext context,
            TokenList tokens,
            boolean inCode)
method for processing this command. Note this processing is not the processing that occurs in the output (*that* is done by the output plugin). This is the processing needed (if any) to determine the token(s) to generate for this command.

Parameters:
gdd - the GDD
context - the parsing context
tokens - TokenList to which the generated tokens are added
inCode - Are we currently in a code section?
Returns:
number of chars to skip to get past the command string in the input. If negative, means an error occurred.


Copyright © 2008-10 Pacific Data Works LLC