Class MultifieldExtractor
- java.lang.Object
-
- jadex.rules.rulesystem.rete.extractors.MultifieldExtractor
-
- All Implemented Interfaces:
IValueExtractor
public class MultifieldExtractor extends java.lang.Object implements IValueExtractor
A multifield extractor has the purpose of extracting a value or a collection of values from a collection type attribute.
-
-
Field Summary
Fields Modifier and Type Field Description protected OAVAttributeType
attr
The attribute.protected int
subindex
The subindex.protected int
tupleindex
The tupleindex.
-
Constructor Summary
Constructors Constructor Description MultifieldExtractor(int tupleindex, OAVAttributeType attr, int subindex)
Create a new extractor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Test for equality.OAVAttributeType
getAttribute()
Get the attribute.AttributeSet
getIndirectAttributes()
Get the set of indirect attribute types.AttributeSet
getRelevantAttributes()
Get the set of relevant attribute types.int
getSubindex()
Get the sub index.int
getTupleIndex()
Get the tuple index.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.int
hashCode()
The hash code.boolean
isAffected(int tupleindex, OAVAttributeType attr)
Test if a constraint evaluator is affected from a change of a certain attribute.java.lang.String
toString()
Get the string representation.
-
-
-
Field Detail
-
tupleindex
protected int tupleindex
The tupleindex.
-
attr
protected OAVAttributeType attr
The attribute.
-
subindex
protected int subindex
The subindex.
-
-
Constructor Detail
-
MultifieldExtractor
public MultifieldExtractor(int tupleindex, OAVAttributeType attr, int subindex)
Create a new 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:
getValue
in 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:
isAffected
in 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:
getRelevantAttributes
in 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:
getIndirectAttributes
in interfaceIValueExtractor
- Returns:
- The relevant attribute types.
-
toString
public java.lang.String toString()
Get the string representation.- Overrides:
toString
in classjava.lang.Object
- Returns:
- The string representation.
-
getAttribute
public OAVAttributeType getAttribute()
Get the attribute.
-
getTupleIndex
public int getTupleIndex()
Get the tuple index.
-
getSubindex
public int getSubindex()
Get the sub index.
-
hashCode
public int hashCode()
The hash code.- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Test for equality.- Overrides:
equals
in classjava.lang.Object
-
-