public abstract class AbstractFunction extends Object implements Function
Function
s.Function
Modifier and Type | Field and Description |
---|---|
protected Logger |
log |
protected String |
name |
protected SpaceParser |
spaceParser |
Modifier | Constructor and Description |
---|---|
protected |
AbstractFunction(String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getHelpDetail()
Get expanded help (typically multiple lines).
|
String |
getName()
Get the name of this function.
|
EnumSet<SessionMode> |
getSessionModes()
Get the
SessionMode (s) supported by this instance. |
protected Node[] |
parseExpressionParams(ParseSession session,
ParseContext ctx,
boolean complete,
int skippedArgs,
int minArgs,
int maxArgs)
Parse some number of Java expression function arguments.
|
protected Node |
parseNextParameter(ParseSession session,
ParseContext ctx,
boolean complete,
int skippedArgs,
List<Node> paramList)
Parse the next function parameter.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply, getHelpSummary, getUsage, parseParams
protected final Logger log
protected final SpaceParser spaceParser
protected final String name
protected AbstractFunction(String name)
name
- function namepublic String getName()
Function
public String getHelpDetail()
The implementation in AbstractFunction
delegates to getHelpSummary()
.
The implementation in AbstractFunction
just delegates to getHelpSummary()
.
getHelpDetail
in interface Function
public EnumSet<SessionMode> getSessionModes()
SessionMode
(s) supported by this instance.
The implementation in AbstractFunction
returns an EnumSet
containing
SessionMode.CORE_API
and SessionMode.PERMAZEN
.
getSessionModes
in interface Function
SessionMode
sprotected Node[] parseExpressionParams(ParseSession session, ParseContext ctx, boolean complete, int skippedArgs, int minArgs, int maxArgs)
session
- parse sessionctx
- parse contextcomplete
- false if parse is "for real", true if only for tab completion calculationskippedArgs
- the number of arguments already parsedminArgs
- minimum number of argumentsmaxArgs
- maximum number of argumentsParseException
- if parse fails, or if complete
is true and there are valid completionsprotected Node parseNextParameter(ParseSession session, ParseContext ctx, boolean complete, int skippedArgs, List<Node> paramList)
parseExpressionParams()
.
The implementation in AbstractFunction
delegates to ExprParser.parse()
.
session
- parse sessionctx
- parse contextcomplete
- false if parse is "for real", true if only for tab completion calculationskippedArgs
- the number of arguments parsed prior to parseExpressionParams()
paramList
- the parameters already parsed by parseExpressionParams()
ParseException
- if parse fails, or if complete
is true and there are valid completionsCopyright © 2022. All rights reserved.