Class FactPattern
- java.lang.Object
-
- org.drools.workbench.models.datamodel.rule.FactPattern
-
- All Implemented Interfaces:
HasCEPWindow,HasConstraints,IFactPattern,IPattern
public class FactPattern extends Object implements IFactPattern, HasCEPWindow, HasConstraints
A fact pattern is a declaration of a fact type, and its constraint, and perhaps a variable that is it bound to It is the equivalent of a "pattern" in drools terms.
-
-
Constructor Summary
Constructors Constructor Description FactPattern()FactPattern(String factType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConstraint(FieldConstraint constraint)This will add a top level constraint.booleanequals(Object o)StringgetBoundName()FieldConstraintgetConstraint(int index)CompositeFieldConstraintgetConstraintList()StringgetFactType()FieldConstraint[]getFieldConstraints()This will return the list of field constraints that are in the root CompositeFieldConstraint object.intgetNumberOfConstraints()CEPWindowgetWindow()inthashCode()booleanisBound()Returns true if there is a variable bound to this fact.booleanisNegated()voidmoveDown(int index)voidmoveUp(int index)voidremoveConstraint(int idx)voidsetBoundName(String boundName)voidsetFactType(String factType)WARNING!voidsetFieldConstraints(List<FieldConstraint> sortedConstraints)voidsetNegated(boolean isNegated)voidsetWindow(CEPWindow window)
-
-
-
Constructor Detail
-
FactPattern
public FactPattern()
-
FactPattern
public FactPattern(String factType)
-
-
Method Detail
-
getBoundName
public String getBoundName()
-
setBoundName
public void setBoundName(String boundName)
-
isNegated
public boolean isNegated()
-
setNegated
public void setNegated(boolean isNegated)
-
addConstraint
public void addConstraint(FieldConstraint constraint)
This will add a top level constraint.- Specified by:
addConstraintin interfaceHasConstraints
-
removeConstraint
public void removeConstraint(int idx)
- Specified by:
removeConstraintin interfaceHasConstraints
-
isBound
public boolean isBound()
Returns true if there is a variable bound to this fact.
-
getFieldConstraints
public FieldConstraint[] getFieldConstraints()
This will return the list of field constraints that are in the root CompositeFieldConstraint object. If there is no root, then an empty array will be returned.- Returns:
- an empty array, or the list of constraints (which may be composites).
-
setFieldConstraints
public void setFieldConstraints(List<FieldConstraint> sortedConstraints)
-
getFactType
public String getFactType()
- Specified by:
getFactTypein interfaceIFactPattern
-
setFactType
public void setFactType(String factType)
WARNING! This method should only be used for fixtures purposes!- Parameters:
factType-
-
setWindow
public void setWindow(CEPWindow window)
- Specified by:
setWindowin interfaceHasCEPWindow
-
getWindow
public CEPWindow getWindow()
- Specified by:
getWindowin interfaceHasCEPWindow
-
getConstraint
public FieldConstraint getConstraint(int index)
- Specified by:
getConstraintin interfaceHasConstraints
-
moveUp
public void moveUp(int index)
- Specified by:
moveUpin interfaceHasConstraints
-
moveDown
public void moveDown(int index)
- Specified by:
moveDownin interfaceHasConstraints
-
getNumberOfConstraints
public int getNumberOfConstraints()
- Specified by:
getNumberOfConstraintsin interfaceHasConstraints
-
getConstraintList
public CompositeFieldConstraint getConstraintList()
-
-