Class FunctionExtractor
- java.lang.Object
-
- jadex.rules.rulesystem.rete.extractors.FunctionExtractor
-
- All Implemented Interfaces:
IValueExtractor
public class FunctionExtractor extends java.lang.Object implements IValueExtractor
A function extractor has the purpose to call a function and return the result value.
-
-
Field Summary
Fields Modifier and Type Field Description protected IValueExtractor[]extractorsThe extractors.protected IFunctionfunctionThe function.
-
Constructor Summary
Constructors Constructor Description FunctionExtractor(IFunction function, IValueExtractor[] extractors)Create a new evaluator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Test for equality.IFunctiongetFunction()Get the function.AttributeSetgetIndirectAttributes()Get the set of indirect attribute types.AttributeSetgetRelevantAttributes()Get the set of relevant attribute types.java.lang.ObjectgetValue(Tuple left, java.lang.Object right, java.lang.Object prefix, IOAVState state)Get the value of an attribute from an object or tuple.IValueExtractor[]getValueExtractors()Get the value extractors.inthashCode()The hash code.booleanisAffected(int tupleindex, OAVAttributeType attr)Test if a constraint evaluator is affected from a change of a certain attribute.java.lang.StringtoString()Get the string representation.
-
-
-
Field Detail
-
function
protected IFunction function
The function.
-
extractors
protected IValueExtractor[] extractors
The extractors.
-
-
Constructor Detail
-
FunctionExtractor
public FunctionExtractor(IFunction function, IValueExtractor[] extractors)
Create a new evaluator.
-
-
Method Detail
-
getValue
public java.lang.Object getValue(Tuple left, java.lang.Object right, java.lang.Object prefix, IOAVState state)
Get the value of an attribute from an object or tuple.- Specified by:
getValuein interfaceIValueExtractor- Parameters:
left- The left input tuple.right- The right input object.prefix- The prefix input object (last value from previous extractor in a chain).state- The working memory.
-
isAffected
public boolean isAffected(int tupleindex, OAVAttributeType attr)Test if a constraint evaluator is affected from a change of a certain attribute.- Specified by:
isAffectedin interfaceIValueExtractor- Parameters:
tupleindex- The tuple index.attr- The attribute.- Returns:
- True, if affected.
-
getRelevantAttributes
public AttributeSet getRelevantAttributes()
Get the set of relevant attribute types.- Specified by:
getRelevantAttributesin interfaceIValueExtractor- Returns:
- The relevant attribute types.
-
getIndirectAttributes
public AttributeSet getIndirectAttributes()
Get the set of indirect attribute types. I.e. attributes of objects, which are not part of an object conditions (e.g. for chained extractors)- Specified by:
getIndirectAttributesin interfaceIValueExtractor- Returns:
- The relevant attribute types.
-
toString
public java.lang.String toString()
Get the string representation.- Overrides:
toStringin classjava.lang.Object- Returns:
- The string representation.
-
getValueExtractors
public IValueExtractor[] getValueExtractors()
Get the value extractors.
-
getFunction
public IFunction getFunction()
Get the function.
-
hashCode
public int hashCode()
The hash code.- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Test for equality.- Overrides:
equalsin classjava.lang.Object
-
-