org.drools.common
Class AgendaItem

java.lang.Object
  extended by org.drools.common.AgendaItem
All Implemented Interfaces:
Externalizable, Serializable, Queueable, org.drools.runtime.rule.Activation
Direct Known Subclasses:
ScheduledAgendaItem

public class AgendaItem
extends Object
implements Activation, Queueable, Externalizable

Item entry in the Agenda.

See Also:
Serialized Form

Constructor Summary
AgendaItem()
           
AgendaItem(long activationNumber, LeftTuple tuple, int salience, PropagationContext context, RuleTerminalNode rtn)
          Construct.
 
Method Summary
 void addBlocked(LinkedListNode node)
           
 void addLogicalDependency(LogicalDependency node)
           
 void cancel()
           
 void dequeue()
           
 void enqueued(int index)
           
 boolean equals(Object object)
           
 ActivationGroupNode getActivationGroupNode()
           
 ActivationNode getActivationNode()
           
 long getActivationNumber()
          Each PropgationContext is assigned an id from a counter for the WorkingMemory action it represents.
 AgendaGroup getAgendaGroup()
           
 LinkedList getBlocked()
           
 LinkedList getBlockers()
           
 List<String> getDeclarationIDs()
           
 Object getDeclarationValue(String variableName)
           
 InternalFactHandle getFactHandle()
           
 List<FactHandle> getFactHandles()
           
 int getIndex()
           
 LinkedList getLogicalDependencies()
           
 List<Object> getObjects()
           
 PropagationContext getPropagationContext()
          Retrieve the PropagationContext for the Activation
 Rule getRule()
          Retrieve the rule.
 RuleTerminalNode getRuleTerminalNode()
           
 int getSalience()
           
 int getSequenence()
           
 GroupElement getSubRule()
          Retrieve the subrule that was activated.
 LeftTuple getTuple()
          Retrieve the tuple.
 int hashCode()
          Return the hashCode of the TupleKey as the hashCode of the AgendaItem
 boolean isActivated()
           
 boolean isActive()
           
 boolean isCanceled()
           
 boolean isMatched()
           
 void readExternal(ObjectInput in)
           
 void remove()
          Cancel the Activation by removing it from the Agenda.
 void removeAllBlockersAndBlocked(DefaultAgenda agenda)
           
 void removeBlocked(LinkedListNode node)
           
 void setActivated(boolean activated)
           
 void setActivationGroupNode(ActivationGroupNode activationNode)
           
 void setActivationNode(ActivationNode activationNode)
           
 void setAgendaGroup(InternalAgendaGroup agendaGroup)
           
 void setBlocked(LinkedList justified)
           
 void setFactHandle(InternalFactHandle factHandle)
           
 void setLogicalDependencies(LinkedList justified)
           
 void setMatched(boolean matched)
           
 void setPropagationContext(PropagationContext context)
           
 void setSalience(int salience)
           
 void setSequenence(int sequenence)
           
 String toExternalForm()
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgendaItem

public AgendaItem()

AgendaItem

public AgendaItem(long activationNumber,
                  LeftTuple tuple,
                  int salience,
                  PropagationContext context,
                  RuleTerminalNode rtn)
Construct.

Parameters:
tuple - The tuple.
rule - The rule.
Method Detail

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

getPropagationContext

public PropagationContext getPropagationContext()
Description copied from interface: Activation
Retrieve the PropagationContext for the Activation

Specified by:
getPropagationContext in interface org.drools.runtime.rule.Activation
Returns:
The propagation context

setPropagationContext

public void setPropagationContext(PropagationContext context)

getRule

public Rule getRule()
Retrieve the rule.

Specified by:
getRule in interface org.drools.runtime.rule.Activation
Returns:
The rule.

getTuple

public LeftTuple getTuple()
Retrieve the tuple.

Returns:
The tuple.

getSalience

public int getSalience()

setSalience

public void setSalience(int salience)

getSequenence

public int getSequenence()

setSequenence

public void setSequenence(int sequenence)

getFactHandle

public InternalFactHandle getFactHandle()

setFactHandle

public void setFactHandle(InternalFactHandle factHandle)

getActivationNumber

public long getActivationNumber()
Description copied from interface: Activation
Each PropgationContext is assigned an id from a counter for the WorkingMemory action it represents. All Activations return this id as the ActivationNumber, thus all Activations created from the same PropgationContext will return the same long for this method.

Returns:
The activation number

addBlocked

public void addBlocked(LinkedListNode node)

removeAllBlockersAndBlocked

public void removeAllBlockersAndBlocked(DefaultAgenda agenda)

removeBlocked

public void removeBlocked(LinkedListNode node)

setBlocked

public void setBlocked(LinkedList justified)

getBlocked

public LinkedList getBlocked()

getBlockers

public LinkedList getBlockers()

addLogicalDependency

public void addLogicalDependency(LogicalDependency node)

getLogicalDependencies

public LinkedList getLogicalDependencies()

setLogicalDependencies

public void setLogicalDependencies(LinkedList justified)

isActivated

public boolean isActivated()

setActivated

public void setActivated(boolean activated)

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

hashCode

public int hashCode()
Return the hashCode of the TupleKey as the hashCode of the AgendaItem

Overrides:
hashCode in class Object
Returns:

enqueued

public void enqueued(int index)
Specified by:
enqueued in interface Queueable

dequeue

public void dequeue()
Specified by:
dequeue in interface Queueable

getIndex

public int getIndex()

remove

public void remove()
Description copied from interface: Activation
Cancel the Activation by removing it from the Agenda.


getActivationGroupNode

public ActivationGroupNode getActivationGroupNode()

setActivationGroupNode

public void setActivationGroupNode(ActivationGroupNode activationNode)

getAgendaGroup

public AgendaGroup getAgendaGroup()

setAgendaGroup

public void setAgendaGroup(InternalAgendaGroup agendaGroup)

getActivationNode

public ActivationNode getActivationNode()

setActivationNode

public void setActivationNode(ActivationNode activationNode)

getSubRule

public GroupElement getSubRule()
Description copied from interface: Activation
Retrieve the subrule that was activated.

Returns:

getRuleTerminalNode

public RuleTerminalNode getRuleTerminalNode()

getFactHandles

public List<FactHandle> getFactHandles()
Specified by:
getFactHandles in interface org.drools.runtime.rule.Activation

toExternalForm

public String toExternalForm()

getObjects

public List<Object> getObjects()
Specified by:
getObjects in interface org.drools.runtime.rule.Activation

getDeclarationValue

public Object getDeclarationValue(String variableName)
Specified by:
getDeclarationValue in interface org.drools.runtime.rule.Activation

getDeclarationIDs

public List<String> getDeclarationIDs()
Specified by:
getDeclarationIDs in interface org.drools.runtime.rule.Activation

isActive

public boolean isActive()
Specified by:
isActive in interface org.drools.runtime.rule.Activation

isCanceled

public boolean isCanceled()

cancel

public void cancel()

isMatched

public boolean isMatched()

setMatched

public void setMatched(boolean matched)


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