Class ExecutableExpression<T>
java.lang.Object
io.github.syst3ms.skriptparser.lang.Statement
io.github.syst3ms.skriptparser.lang.Effect
io.github.syst3ms.skriptparser.lang.base.ExecutableExpression<T>
- All Implemented Interfaces:
Expression<T>, SyntaxElement
- Direct Known Subclasses:
ExecExprListOperators, ExecExprReplace
A base class for syntax that can be used as
The behaviour is different based on how the syntax is used:
Expression or Effect.
An example of this could be:
replace all {x} in {y} with {z} print "%replace all {x} in {y} with {z}%
The behaviour is different based on how the syntax is used:
- If the syntax is used like an expression, the result should not change any expressions (like variables) whatsoever.
- Otherwise, if the syntax is used like an effect, the result should be used to perform actions according to the syntax.
ExecExprListOperators:
set {x} to pop {y::*} should set the variable x to the last element of the list y. pop {y::*} should remove the last element of the list y, because it is used as an effect now.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexecute(TriggerContext ctx) T[]getValues(TriggerContext ctx) Retrieves all values of this Expression, accounting for possible modifiers.abstract T[]getValues(TriggerContext ctx, boolean isEffect) Retrieves all values of this expression, if used as one.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Expression
acceptsChange, acceptsChange, acceptsChange, change, check, check, convertExpression, getArray, getReturnType, getSingle, getSource, isAndList, isLoopOf, isSingle, iterator, setAndList, streamMethods inherited from interface SyntaxElement
init, toString
-
Constructor Details
-
ExecutableExpression
public ExecutableExpression()
-
-
Method Details
-
execute
-
getValues
Description copied from interface:ExpressionRetrieves all values of this Expression, accounting for possible modifiers. This means that if this is an or-list, it will choose a random value to return.- Specified by:
getValuesin interfaceExpression<T>- Parameters:
ctx- the event- Returns:
- an array of the values
- See Also:
-
getValues
Retrieves all values of this expression, if used as one. Otherwise, if used as an effect, performs side-effects with certainbehaviour. Note that when this is not the case, this syntax, by convention, should not have any side-effects.- Parameters:
ctx- the contextisEffect- whether this syntax is used as effect or as an expression- Returns:
- an array of the values
-