org.drools.ide.common.client.modeldriven.brl
Class FactPattern

java.lang.Object
  extended by org.drools.ide.common.client.modeldriven.brl.FactPattern
All Implemented Interfaces:
Serializable, HasCEPWindow, HasConstraints, IFactPattern, IPattern, PortableObject

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.

See Also:
Serialized Form

Field Summary
 CompositeFieldConstraint constraintList
           
 
Constructor Summary
FactPattern()
           
FactPattern(String factType)
           
 
Method Summary
 void addConstraint(FieldConstraint constraint)
          This will add a top level constraint.
 String getBoundName()
           
 FieldConstraint getConstraint(int index)
           
 String getFactType()
           
 FieldConstraint[] getFieldConstraints()
          This will return the list of field constraints that are in the root CompositeFieldConstraint object.
 int getNumberOfConstraints()
           
 CEPWindow getWindow()
           
 boolean isBound()
          Returns true if there is a variable bound to this fact.
 boolean isNegated()
           
 void removeConstraint(int idx)
           
 void setBoundName(String boundName)
           
 void setFactType(String factType)
          WARNING!
 void setFieldConstraints(List sortedConstraints)
           
 void setNegated(boolean isNegated)
           
 void setWindow(CEPWindow window)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

constraintList

public CompositeFieldConstraint constraintList
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:
addConstraint in interface HasConstraints

removeConstraint

public void removeConstraint(int idx)
Specified by:
removeConstraint in interface HasConstraints

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 sortedConstraints)

getFactType

public String getFactType()
Specified by:
getFactType in interface IFactPattern

setFactType

public void setFactType(String factType)
WARNING! This method should only be used for testing purposes!

Parameters:
factType -

setWindow

public void setWindow(CEPWindow window)
Specified by:
setWindow in interface HasCEPWindow

getWindow

public CEPWindow getWindow()
Specified by:
getWindow in interface HasCEPWindow

getConstraint

public FieldConstraint getConstraint(int index)
Specified by:
getConstraint in interface HasConstraints

getNumberOfConstraints

public int getNumberOfConstraints()
Specified by:
getNumberOfConstraints in interface HasConstraints


Copyright © 2001-2011 JBoss by Red Hat. All Rights Reserved.