Class ExpressionOperator
java.lang.Object
org.cyclops.integrateddynamics.core.evaluate.operator.OperatorBase
org.cyclops.integrateddynamics.core.evaluate.expression.tree.ExpressionOperator
- All Implemented Interfaces:
IOperator
An operator defined by an expression tree with parameters.
The parameters of the expression are the inputs of this operator.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classMatches operator values of expressions, also with some of their inputs applied, optionally by the number of parameters of the expression.Nested classes/interfaces inherited from class OperatorBase
OperatorBase.IFunction, OperatorBase.SafeVariablesGetter -
Constructor Summary
ConstructorsConstructorDescriptionExpressionOperator(Expression expression, it.unimi.dsi.fastutil.ints.Int2ObjectMap<IVariable<?>> refs, IValueType<?> outputType) -
Method Summary
Modifier and TypeMethodDescriptionbooleannet.minecraft.network.chat.MutableComponentit.unimi.dsi.fastutil.ints.Int2ObjectMap<IVariable<?>> getRefs()protected StringinthashCode()voidloadTooltip(Consumer<net.minecraft.network.chat.Component> tooltipAdder, boolean appendOptionalInfo) Add tooltip lines for this aspect when hovered in a gui.Materialize this operator so that it can exist without any external references.static ExpressionOperatorof(Expression expression) static ExpressionOperatorof(Expression expression, it.unimi.dsi.fastutil.ints.Int2ObjectMap<IVariable<?>> refs) Create an operator for the given expression, inferring its output type.toString()Methods inherited from class OperatorBase
constructInputVariables, evaluate, getConditionalOutputType, getFunction, getGlobalInteractNamePrefix, getInputTypes, getInteractName, getModId, getOperatorName, getOutputType, getRenderPattern, getRequiredInputLength, getSymbol, getTranslationKey, getUniqueName, getUnlocalizedCategoryName, getUnlocalizedCategoryPrefix, getUnlocalizedPrefix, shouldAlsoPrefixLocalScope, validateTypesMethods inherited from interface IOperator
getGlobalInteractName, getScopedInteractName
-
Constructor Details
-
ExpressionOperator
public ExpressionOperator(Expression expression, it.unimi.dsi.fastutil.ints.Int2ObjectMap<IVariable<?>> refs, IValueType<?> outputType) - Parameters:
expression- The expression, its parameters define the operator inputs.refs- Bound variables for references in the expression.outputType- The output type.
-
-
Method Details
-
of
public static ExpressionOperator of(Expression expression, it.unimi.dsi.fastutil.ints.Int2ObjectMap<IVariable<?>> refs) Create an operator for the given expression, inferring its output type.- Parameters:
expression- The expression.refs- Bound variables for references in the expression.- Returns:
- The operator.
-
of
-
getUnlocalizedType
- Specified by:
getUnlocalizedTypein classOperatorBase
-
getExpression
-
getRefs
-
getLocalizedNameFull
public net.minecraft.network.chat.MutableComponent getLocalizedNameFull()- Specified by:
getLocalizedNameFullin interfaceIOperator- Overrides:
getLocalizedNameFullin classOperatorBase- Returns:
- The localized full name for this operator, includes category name
-
loadTooltip
public void loadTooltip(Consumer<net.minecraft.network.chat.Component> tooltipAdder, boolean appendOptionalInfo) Description copied from interface:IOperatorAdd tooltip lines for this aspect when hovered in a gui.- Specified by:
loadTooltipin interfaceIOperator- Overrides:
loadTooltipin classOperatorBase- Parameters:
tooltipAdder- The list to add lines to.appendOptionalInfo- If shift-to-show info should be added.
-
getMaterializedExpression
- Returns:
- The expression where all references are replaced by their current values.
- Throws:
EvaluationException- If a referenced value could not be evaluated.
-
materialize
Description copied from interface:IOperatorMaterialize this operator so that it can exist without any external references.- Specified by:
materializein interfaceIOperator- Overrides:
materializein classOperatorBase- Returns:
- The materialized operator.
- Throws:
EvaluationException- if materialization fails because of a variable evaluation.
-
equals
-
hashCode
-
toString
- Overrides:
toStringin classOperatorBase
-