Contents
- Description
- Nested Class Summary
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- copyOf(StdScope)
- merge(StdScope)
- mergeScopes(StdScope, StdScope)
- addConst(String, String)
- addConst(String, double)
- addConst(String, boolean)
- addConst(String, String[])
- addConst(String, double[])
- addConst(String, boolean[])
- addConstEmptyArray(String)
- addVar(String, String)
- addVar(String, double)
- addVar(String, boolean)
- addVar(String, String[])
- addVar(String, double[])
- addVar(String, boolean[])
- addInvariant(String, Scope.Function, ValueType, ValueType...)
- addVariant(String, Scope.Function, ValueType, ValueType...)
- addSupplier(String, Supplier)
- addSupplier(String, DoubleSupplier)
- addSupplier(String, BooleanSupplier)
- addStringArraySupplier(String, Supplier)
- addDoubleArraySupplier(String, Supplier)
- addBooleanArraySupplier(String, Supplier)
- changeValue(String, String)
- changeValue(String, double)
- changeValue(String, boolean)
- changeValue(String, String[])
- changeValue(String, double[])
- changeValue(String, boolean[])
- changeValueToEmptyArray(String)
- getStringSupplier(String)
- getNumberSupplier(String)
- getBooleanSupplier(String)
- getStringArraySupplier(String)
- getNumberArraySupplier(String)
- getBooleanArraySupplier(String)
- getFunction(String)
- isConstant(String)
- getType(String)
Class StdScope
java.lang.Object
com.hypixel.hytale.server.npc.util.expression.StdScope
- All Implemented Interfaces:
Scope
- Direct Known Subclasses:
StdLib
-
Nested Class Summary
Nested classes/interfaces inherited from interface Scope
Scope.Function -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBooleanArraySupplier(String name, Supplier<boolean[]> value) voidvoidvoidvoidvoidvoidvoidaddConstEmptyArray(String name) voidaddDoubleArraySupplier(String name, Supplier<double[]> value) voidaddInvariant(String name, Scope.Function function, ValueType returnType, ValueType... argumentTypes) voidaddStringArraySupplier(String name, Supplier<String[]> value) voidaddSupplier(String name, BooleanSupplier value) voidaddSupplier(String name, DoubleSupplier value) voidaddSupplier(String name, Supplier<String> value) voidvoidvoidvoidvoidvoidvoidaddVariant(String name, Scope.Function function, ValueType returnType, ValueType... argumentTypes) voidchangeValue(String name, boolean value) Change value of variable in a scope.voidchangeValue(String name, boolean[] value) Change value of variable in a scope.voidchangeValue(String name, double value) Change value of variable in a scope.voidchangeValue(String name, double[] value) Change value of variable in a scope.voidchangeValue(String name, String value) Change value of variable in a scope.voidchangeValue(String name, String[] value) Change value of variable in a scope.voidChange value of variable in a scope to empty array.static StdScopeShallow clone a scope (but not the symbols itself).Supplier<boolean[]> getBooleanSupplier(String name) getFunction(String name) Supplier<double[]> getNumberArraySupplier(String name) getNumberSupplier(String name) getStringArraySupplier(String name) getStringSupplier(String name) booleanisConstant(String name) Check if a variable is a constant or a function always returns the same result for the same set of arguments.Merge symbols of another scope into current scope.static StdScopemergeScopes(StdScope first, StdScope second) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Scope
getBoolean, getBooleanArray, getNumber, getNumberArray, getString, getStringArray
-
Constructor Details
-
StdScope
-
-
Method Details
-
copyOf
-
merge
-
mergeScopes
-
addConst
-
addConst
-
addConst
-
addConst
-
addConst
-
addConst
-
addConstEmptyArray
-
addVar
-
addVar
-
addVar
-
addVar
-
addVar
-
addVar
-
addInvariant
public void addInvariant(@Nonnull String name, Scope.Function function, ValueType returnType, @Nonnull ValueType... argumentTypes) -
addVariant
public void addVariant(@Nonnull String name, Scope.Function function, ValueType returnType, @Nonnull ValueType... argumentTypes) -
addSupplier
-
addSupplier
-
addSupplier
-
addStringArraySupplier
-
addDoubleArraySupplier
-
addBooleanArraySupplier
-
changeValue
-
changeValue
Change value of variable in a scope.Use copy-on-write to create an new symbol for a changed value.
- Parameters:
name- Name of variablevalue- New value of variable
-
changeValue
Change value of variable in a scope.Use copy-on-write to create an new symbol for a changed value.
- Parameters:
name- Name of variablevalue- New value of variable
-
changeValue
-
changeValue
Change value of variable in a scope.Use copy-on-write to create an new symbol for a changed value.
- Parameters:
name- Name of variablevalue- New value of variable
-
changeValue
Change value of variable in a scope.Use copy-on-write to create an new symbol for a changed value.
- Parameters:
name- Name of variablevalue- New value of variable
-
changeValueToEmptyArray
Change value of variable in a scope to empty array.Use copy-on-write to create an new symbol for a changed value.
- Parameters:
name- Name of variable
-
getStringSupplier
- Specified by:
getStringSupplierin interfaceScope
-
getNumberSupplier
- Specified by:
getNumberSupplierin interfaceScope
-
getBooleanSupplier
- Specified by:
getBooleanSupplierin interfaceScope
-
getStringArraySupplier
- Specified by:
getStringArraySupplierin interfaceScope
-
getNumberArraySupplier
- Specified by:
getNumberArraySupplierin interfaceScope
-
getBooleanArraySupplier
- Specified by:
getBooleanArraySupplierin interfaceScope
-
getFunction
- Specified by:
getFunctionin interfaceScope
-
isConstant
Description copied from interface:ScopeCheck if a variable is a constant or a function always returns the same result for the same set of arguments.- Specified by:
isConstantin interfaceScope- Parameters:
name- Name of function/variable.- Returns:
- true if variable is constant or function is invariant
-
getType
-