Package com.jackmeng.stl
Class stl_Commands.Commands_Fx
java.lang.Object
com.jackmeng.stl.stl_Commands.Commands_Fx
- All Implemented Interfaces:
stl_Callback<java.lang.String,java.lang.String>
- Direct Known Subclasses:
stl_Commands.Type_DYNAMIC
,stl_Commands.Type_HYBRID
,stl_Commands.Type_INFORMATIONAL
,stl_Commands.Type_STATIC
- Enclosing class:
- stl_Commands
private abstract static class stl_Commands.Commands_Fx extends java.lang.Object implements stl_Callback<java.lang.String,java.lang.String>
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
commandName
private boolean
finished
private java.lang.String
properName
-
Constructor Summary
Constructors Constructor Description Commands_Fx()
Commands_Fx(java.lang.String properName, java.lang.String commandName)
Constructs the necessary Command Function Object. -
Method Summary
Modifier and Type Method Description abstract stl_Commands.Commands_Type[]
associated_types()
java.lang.String
call(java.lang.String argument)
Call this callback with the specified attributes.java.lang.String
commandName()
abstract java.lang.String
consume(java.lang.String argument)
Called by the original stl_Commands parser on every tick to parse and run another argument that was related to this argument.boolean
finished()
Should tell the original stl_Commands if this current consumer function has done its job.boolean
matches(java.lang.String input)
java.lang.String
properName()
abstract java.lang.String
sequence()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
finished
private boolean finished -
properName
private final java.lang.String properName -
commandName
private final java.lang.String commandName
-
-
Constructor Details
-
Commands_Fx
public Commands_Fx(java.lang.String properName, java.lang.String commandName)Constructs the necessary Command Function Object. There is also a separate constructor, which inputs a null String as the default name ("DO NOT USE").
- Parameters:
properName
- The properName is the string used in the real command argument. It should preferably be all lowercase with underscores or all uppercase.commandName
- The commandName is the string used in the readable definitions and manual definitions of the command. It should not be used for anything else.
-
Commands_Fx
public Commands_Fx()
-
-
Method Details
-
properName
public java.lang.String properName() -
commandName
public java.lang.String commandName() -
matches
public boolean matches(java.lang.String input) -
consume
public abstract java.lang.String consume(java.lang.String argument)Called by the original stl_Commands parser on every tick to parse and run another argument that was related to this argument.- Parameters:
argument
- The input argument- Returns:
- The next argument to be asked by stl_Commands. if this is null, the stl_Commands move on to the next Consumer (AKA argument)
-
sequence
public abstract java.lang.String sequence()- Returns:
- The prefix of the command name. Should be standarized to '-','--',or'---''
-
call
public java.lang.String call(java.lang.String argument)Description copied from interface:stl_Callback
Call this callback with the specified attributes.- Specified by:
call
in interfacestl_Callback<java.lang.String,java.lang.String>
- Parameters:
argument
- The specified parameter type- Returns:
- The specified return type. Return "null" if the return type was set to
Void
-
finished
public boolean finished()Should tell the original stl_Commands if this current consumer function has done its job.- Returns:
- (true -> done >|| false -> not done)
-
associated_types
-