Drools :: Core 6.1.0.Beta1

org.drools.core.common
Class AgendaItemImpl

java.lang.Object
  extended by org.drools.core.common.AgendaItemImpl
All Implemented Interfaces:
Serializable, AgendaItem, Activation, org.kie.api.runtime.rule.Match
Direct Known Subclasses:
RuleAgendaItem

public class AgendaItemImpl
extends Object
implements AgendaItem

Item entry in the Agenda.

See Also:
Serialized Form

Constructor Summary
AgendaItemImpl()
           
AgendaItemImpl(long activationNumber, LeftTuple tuple, int salience, PropagationContext context, TerminalNode rtn, RuleAgendaItem ruleAgendaItem, InternalAgendaGroup agendaGroup)
          Construct.
 
Method Summary
 void addBlocked(LogicalDependency dep)
           
 void addLogicalDependency(LogicalDependency node)
           
 void cancel()
           
 void dequeue()
           
 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.
 org.kie.internal.event.rule.ActivationUnMatchListener getActivationUnMatchListener()
           
 InternalAgendaGroup getAgendaGroup()
           
 LinkedList<LogicalDependency> getBlocked()
           
 LinkedList<LinkedListEntry<LogicalDependency>> getBlockers()
           
 Consequence getConsequence()
           
 List<String> getDeclarationIds()
           
 Object getDeclarationValue(String variableName)
           
 InternalFactHandle getFactHandle()
           
 List<FactHandle> getFactHandles()
           
 LinkedList<LogicalDependency> getLogicalDependencies()
           
 List<Object> getObjects()
           
 PropagationContext getPropagationContext()
          Retrieve the PropagationContext for the Activation
 int getQueueIndex()
           
 Rule getRule()
          Retrieve the rule.
 RuleAgendaItem getRuleAgendaItem()
           
 int getSalience()
           
 GroupElement getSubRule()
          Retrieve the subrule that was activated.
 TerminalNode getTerminalNode()
           
 LeftTuple getTuple()
          Retrieve the tuple.
 int hashCode()
          Return the hashCode of the TupleKey as the hashCode of the AgendaItem
 boolean isActive()
           
 boolean isCanceled()
           
 boolean isMatched()
           
 boolean isQueued()
           
 boolean isRuleAgendaItem()
           
 void remove()
          Cancel the Activation by removing it from the Agenda.
 void removeAllBlockersAndBlocked(InternalAgenda agenda)
           
 void removeBlocked(LogicalDependency dep)
           
 void setActivationGroupNode(ActivationGroupNode activationNode)
           
 void setActivationNode(ActivationNode activationNode)
           
 void setActivationUnMatchListener(org.kie.internal.event.rule.ActivationUnMatchListener activationUnMatchListener)
           
 void setActive(boolean active)
           
 void setBlocked(LinkedList<LogicalDependency> justified)
           
 void setFactHandle(InternalFactHandle factHandle)
           
 void setLogicalDependencies(LinkedList<LogicalDependency> justified)
           
 void setMatched(boolean matched)
           
 void setPropagationContext(PropagationContext context)
           
 void setQueued(boolean queued)
           
 void setQueueIndex(int index)
           
 void setSalience(int salience)
           
 String toExternalForm()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgendaItemImpl

public AgendaItemImpl()

AgendaItemImpl

public AgendaItemImpl(long activationNumber,
                      LeftTuple tuple,
                      int salience,
                      PropagationContext context,
                      TerminalNode rtn,
                      RuleAgendaItem ruleAgendaItem,
                      InternalAgendaGroup agendaGroup)
Construct.

Parameters:
tuple - The tuple.
ruleAgendaItem -
agendaGroup -
Method Detail

getPropagationContext

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

Specified by:
getPropagationContext in interface AgendaItem
Specified by:
getPropagationContext in interface Activation
Returns:
The propagation context

setPropagationContext

public void setPropagationContext(PropagationContext context)
Specified by:
setPropagationContext in interface AgendaItem

getRule

public Rule getRule()
Retrieve the rule.

Specified by:
getRule in interface AgendaItem
Specified by:
getRule in interface Activation
Specified by:
getRule in interface org.kie.api.runtime.rule.Match
Returns:
The rule.

getConsequence

public Consequence getConsequence()
Specified by:
getConsequence in interface AgendaItem
Specified by:
getConsequence in interface Activation

getTuple

public LeftTuple getTuple()
Retrieve the tuple.

Specified by:
getTuple in interface AgendaItem
Specified by:
getTuple in interface Activation
Returns:
The tuple.

getSalience

public int getSalience()
Specified by:
getSalience in interface AgendaItem
Specified by:
getSalience in interface Activation

setSalience

public void setSalience(int salience)
Specified by:
setSalience in interface AgendaItem

getFactHandle

public InternalFactHandle getFactHandle()
Specified by:
getFactHandle in interface AgendaItem
Specified by:
getFactHandle in interface Activation

setFactHandle

public void setFactHandle(InternalFactHandle factHandle)
Specified by:
setFactHandle in interface AgendaItem

getRuleAgendaItem

public RuleAgendaItem getRuleAgendaItem()
Specified by:
getRuleAgendaItem in interface AgendaItem

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.

Specified by:
getActivationNumber in interface AgendaItem
Specified by:
getActivationNumber in interface Activation
Returns:
The activation number

addBlocked

public void addBlocked(LogicalDependency dep)
Specified by:
addBlocked in interface AgendaItem
Specified by:
addBlocked in interface Activation

removeAllBlockersAndBlocked

public void removeAllBlockersAndBlocked(InternalAgenda agenda)
Specified by:
removeAllBlockersAndBlocked in interface AgendaItem

removeBlocked

public void removeBlocked(LogicalDependency dep)
Specified by:
removeBlocked in interface AgendaItem

getBlocked

public LinkedList<LogicalDependency> getBlocked()
Specified by:
getBlocked in interface AgendaItem
Specified by:
getBlocked in interface Activation

setBlocked

public void setBlocked(LinkedList<LogicalDependency> justified)
Specified by:
setBlocked in interface AgendaItem
Specified by:
setBlocked in interface Activation

getBlockers

public LinkedList<LinkedListEntry<LogicalDependency>> getBlockers()
Specified by:
getBlockers in interface AgendaItem
Specified by:
getBlockers in interface Activation

addLogicalDependency

public void addLogicalDependency(LogicalDependency node)
Specified by:
addLogicalDependency in interface AgendaItem
Specified by:
addLogicalDependency in interface Activation

getLogicalDependencies

public LinkedList<LogicalDependency> getLogicalDependencies()
Specified by:
getLogicalDependencies in interface AgendaItem
Specified by:
getLogicalDependencies in interface Activation

setLogicalDependencies

public void setLogicalDependencies(LinkedList<LogicalDependency> justified)
Specified by:
setLogicalDependencies in interface AgendaItem
Specified by:
setLogicalDependencies in interface Activation

isQueued

public boolean isQueued()
Specified by:
isQueued in interface AgendaItem
Specified by:
isQueued in interface Activation

setQueued

public void setQueued(boolean queued)
Specified by:
setQueued in interface AgendaItem
Specified by:
setQueued in interface Activation

toString

public String toString()
Specified by:
toString in interface AgendaItem
Overrides:
toString in class Object

equals

public boolean equals(Object object)
Specified by:
equals in interface AgendaItem
Overrides:
equals in class Object

hashCode

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

Specified by:
hashCode in interface AgendaItem
Overrides:
hashCode in class Object
Returns:

setQueueIndex

public void setQueueIndex(int index)
Specified by:
setQueueIndex in interface AgendaItem
Specified by:
setQueueIndex in interface Activation

dequeue

public void dequeue()
Specified by:
dequeue in interface AgendaItem
Specified by:
dequeue in interface Activation

getQueueIndex

public int getQueueIndex()
Specified by:
getQueueIndex in interface AgendaItem
Specified by:
getQueueIndex in interface Activation

remove

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

Specified by:
remove in interface AgendaItem
Specified by:
remove in interface Activation

getActivationGroupNode

public ActivationGroupNode getActivationGroupNode()
Specified by:
getActivationGroupNode in interface AgendaItem
Specified by:
getActivationGroupNode in interface Activation

setActivationGroupNode

public void setActivationGroupNode(ActivationGroupNode activationNode)
Specified by:
setActivationGroupNode in interface AgendaItem
Specified by:
setActivationGroupNode in interface Activation

getAgendaGroup

public InternalAgendaGroup getAgendaGroup()
Specified by:
getAgendaGroup in interface AgendaItem
Specified by:
getAgendaGroup in interface Activation

getActivationNode

public ActivationNode getActivationNode()
Specified by:
getActivationNode in interface AgendaItem
Specified by:
getActivationNode in interface Activation

setActivationNode

public void setActivationNode(ActivationNode activationNode)
Specified by:
setActivationNode in interface AgendaItem
Specified by:
setActivationNode in interface Activation

getSubRule

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

Specified by:
getSubRule in interface AgendaItem
Specified by:
getSubRule in interface Activation
Returns:

getTerminalNode

public TerminalNode getTerminalNode()
Specified by:
getTerminalNode in interface AgendaItem

getActivationUnMatchListener

public org.kie.internal.event.rule.ActivationUnMatchListener getActivationUnMatchListener()
Specified by:
getActivationUnMatchListener in interface AgendaItem

setActivationUnMatchListener

public void setActivationUnMatchListener(org.kie.internal.event.rule.ActivationUnMatchListener activationUnMatchListener)
Specified by:
setActivationUnMatchListener in interface AgendaItem

getFactHandles

public List<FactHandle> getFactHandles()
Specified by:
getFactHandles in interface AgendaItem
Specified by:
getFactHandles in interface org.kie.api.runtime.rule.Match

toExternalForm

public String toExternalForm()
Specified by:
toExternalForm in interface AgendaItem

getObjects

public List<Object> getObjects()
Specified by:
getObjects in interface AgendaItem
Specified by:
getObjects in interface org.kie.api.runtime.rule.Match

getDeclarationValue

public Object getDeclarationValue(String variableName)
Specified by:
getDeclarationValue in interface AgendaItem
Specified by:
getDeclarationValue in interface org.kie.api.runtime.rule.Match

getDeclarationIds

public List<String> getDeclarationIds()
Specified by:
getDeclarationIds in interface AgendaItem
Specified by:
getDeclarationIds in interface org.kie.api.runtime.rule.Match

isCanceled

public boolean isCanceled()
Specified by:
isCanceled in interface AgendaItem

cancel

public void cancel()
Specified by:
cancel in interface AgendaItem

isMatched

public boolean isMatched()
Specified by:
isMatched in interface AgendaItem
Specified by:
isMatched in interface Activation

setMatched

public void setMatched(boolean matched)
Specified by:
setMatched in interface AgendaItem
Specified by:
setMatched in interface Activation

isActive

public boolean isActive()
Specified by:
isActive in interface Activation

setActive

public void setActive(boolean active)
Specified by:
setActive in interface Activation

isRuleAgendaItem

public boolean isRuleAgendaItem()
Specified by:
isRuleAgendaItem in interface AgendaItem
Specified by:
isRuleAgendaItem in interface Activation

Drools :: Core 6.1.0.Beta1

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