Class JavaArrayExtractor
- java.lang.Object
-
- jadex.rules.rulesystem.rete.extractors.JavaArrayExtractor
-
- All Implemented Interfaces:
IValueExtractor
public class JavaArrayExtractor extends java.lang.Object implements IValueExtractor
An extractor for getting elements from arrays.
-
-
Field Summary
Fields Modifier and Type Field Description protected IValueExtractorindexThe index value extractor.protected IValueExtractorobjexThe object extractor.
-
Constructor Summary
Constructors Constructor Description JavaArrayExtractor(IValueExtractor objex, IValueExtractor index)Create a new array extractor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.booleanisAffected(int tupleindex, OAVAttributeType attr)Test if a constraint evaluator is affected from a change of a certain attribute.
-
-
-
Field Detail
-
objex
protected IValueExtractor objex
The object extractor.
-
index
protected IValueExtractor index
The index value extractor.
-
-
Constructor Detail
-
JavaArrayExtractor
public JavaArrayExtractor(IValueExtractor objex, IValueExtractor index)
Create a new array extractor.- Parameters:
objex- The object extractor.index- The index extractor.
-
-
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 (-1 for object).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.
-
-