Drools :: Core 6.2.0.Final

org.drools.core.common
Class AgendaItemImpl<T extends ModedAssertion<T>>

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

public class AgendaItemImpl<T extends ModedAssertion<T>>
extends Object
implements AgendaItem<T>

Item entry in the Agenda.

See Also:
Serialized Form

Constructor Summary
AgendaItemImpl()
           
AgendaItemImpl(long activationNumber, LeftTuple tuple, int salience, PropagationContext context, TerminalNode rtn, InternalAgendaGroup agendaGroup)
          Construct.
 
Method Summary
 void addBlocked(LogicalDependency<SimpleMode> dep)
           
 void addLogicalDependency(LogicalDependency<T> 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<SimpleMode>> getBlocked()
           
 LinkedList<SimpleMode> getBlockers()
           
 Consequence getConsequence()
           
 List<String> getDeclarationIds()
           
 Object getDeclarationValue(String variableName)
           
 InternalFactHandle getFactHandle()
           
 List<org.kie.api.runtime.rule.FactHandle> getFactHandles()
           
 LinkedList<LogicalDependency<T>> getLogicalDependencies()
           
 List<Object> getObjects()
           
 PropagationContext getPropagationContext()
          Retrieve the PropagationContext for the Activation
 int getQueueIndex()
           
 RuleImpl 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<SimpleMode> 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<SimpleMode>> justified)
           
 void setFactHandle(InternalFactHandle factHandle)
           
 void setLogicalDependencies(LinkedList<LogicalDependency<T>> 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,
                      InternalAgendaGroup agendaGroup)
Construct.

Parameters:
tuple - The tuple.
agendaGroup -
Method Detail

getPropagationContext

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

Specified by:
getPropagationContext in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
getPropagationContext in interface Activation<T extends ModedAssertion<T>>
Returns:
The propagation context

setPropagationContext

public void setPropagationContext(PropagationContext context)
Specified by:
setPropagationContext in interface AgendaItem<T extends ModedAssertion<T>>

getRule

public RuleImpl getRule()
Retrieve the rule.

Specified by:
getRule in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
getRule in interface Activation<T extends ModedAssertion<T>>
Specified by:
getRule in interface org.kie.api.runtime.rule.Match
Returns:
The rule.

getConsequence

public Consequence getConsequence()
Specified by:
getConsequence in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
getConsequence in interface Activation<T extends ModedAssertion<T>>

getTuple

public LeftTuple getTuple()
Retrieve the tuple.

Specified by:
getTuple in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
getTuple in interface Activation<T extends ModedAssertion<T>>
Returns:
The tuple.

getSalience

public int getSalience()
Specified by:
getSalience in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
getSalience in interface Activation<T extends ModedAssertion<T>>

setSalience

public void setSalience(int salience)
Specified by:
setSalience in interface AgendaItem<T extends ModedAssertion<T>>

getFactHandle

public InternalFactHandle getFactHandle()
Specified by:
getFactHandle in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
getFactHandle in interface Activation<T extends ModedAssertion<T>>

setFactHandle

public void setFactHandle(InternalFactHandle factHandle)
Specified by:
setFactHandle in interface AgendaItem<T extends ModedAssertion<T>>

getRuleAgendaItem

public RuleAgendaItem getRuleAgendaItem()
Specified by:
getRuleAgendaItem in interface AgendaItem<T extends ModedAssertion<T>>

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<T extends ModedAssertion<T>>
Specified by:
getActivationNumber in interface Activation<T extends ModedAssertion<T>>
Returns:
The activation number

addBlocked

public void addBlocked(LogicalDependency<SimpleMode> dep)
Specified by:
addBlocked in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
addBlocked in interface Activation<T extends ModedAssertion<T>>

removeAllBlockersAndBlocked

public void removeAllBlockersAndBlocked(InternalAgenda agenda)
Specified by:
removeAllBlockersAndBlocked in interface AgendaItem<T extends ModedAssertion<T>>

removeBlocked

public void removeBlocked(LogicalDependency<SimpleMode> dep)
Specified by:
removeBlocked in interface AgendaItem<T extends ModedAssertion<T>>

getBlocked

public LinkedList<LogicalDependency<SimpleMode>> getBlocked()
Specified by:
getBlocked in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
getBlocked in interface Activation<T extends ModedAssertion<T>>

setBlocked

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

getBlockers

public LinkedList<SimpleMode> getBlockers()
Specified by:
getBlockers in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
getBlockers in interface Activation<T extends ModedAssertion<T>>

addLogicalDependency

public void addLogicalDependency(LogicalDependency<T> node)
Specified by:
addLogicalDependency in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
addLogicalDependency in interface Activation<T extends ModedAssertion<T>>

getLogicalDependencies

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

setLogicalDependencies

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

isQueued

public boolean isQueued()
Specified by:
isQueued in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
isQueued in interface Activation<T extends ModedAssertion<T>>

setQueued

public void setQueued(boolean queued)
Specified by:
setQueued in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
setQueued in interface Activation<T extends ModedAssertion<T>>

toString

public String toString()
Specified by:
toString in interface AgendaItem<T extends ModedAssertion<T>>
Overrides:
toString in class Object

equals

public boolean equals(Object object)
Specified by:
equals in interface AgendaItem<T extends ModedAssertion<T>>
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<T extends ModedAssertion<T>>
Overrides:
hashCode in class Object
Returns:

setQueueIndex

public void setQueueIndex(int index)
Specified by:
setQueueIndex in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
setQueueIndex in interface Activation<T extends ModedAssertion<T>>

dequeue

public void dequeue()
Specified by:
dequeue in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
dequeue in interface Activation<T extends ModedAssertion<T>>

getQueueIndex

public int getQueueIndex()
Specified by:
getQueueIndex in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
getQueueIndex in interface Activation<T extends ModedAssertion<T>>

remove

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

Specified by:
remove in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
remove in interface Activation<T extends ModedAssertion<T>>

getActivationGroupNode

public ActivationGroupNode getActivationGroupNode()
Specified by:
getActivationGroupNode in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
getActivationGroupNode in interface Activation<T extends ModedAssertion<T>>

setActivationGroupNode

public void setActivationGroupNode(ActivationGroupNode activationNode)
Specified by:
setActivationGroupNode in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
setActivationGroupNode in interface Activation<T extends ModedAssertion<T>>

getAgendaGroup

public InternalAgendaGroup getAgendaGroup()
Specified by:
getAgendaGroup in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
getAgendaGroup in interface Activation<T extends ModedAssertion<T>>

getActivationNode

public ActivationNode getActivationNode()
Specified by:
getActivationNode in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
getActivationNode in interface Activation<T extends ModedAssertion<T>>

setActivationNode

public void setActivationNode(ActivationNode activationNode)
Specified by:
setActivationNode in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
setActivationNode in interface Activation<T extends ModedAssertion<T>>

getSubRule

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

Specified by:
getSubRule in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
getSubRule in interface Activation<T extends ModedAssertion<T>>
Returns:

getTerminalNode

public TerminalNode getTerminalNode()
Specified by:
getTerminalNode in interface AgendaItem<T extends ModedAssertion<T>>

getActivationUnMatchListener

public org.kie.internal.event.rule.ActivationUnMatchListener getActivationUnMatchListener()
Specified by:
getActivationUnMatchListener in interface AgendaItem<T extends ModedAssertion<T>>

setActivationUnMatchListener

public void setActivationUnMatchListener(org.kie.internal.event.rule.ActivationUnMatchListener activationUnMatchListener)
Specified by:
setActivationUnMatchListener in interface AgendaItem<T extends ModedAssertion<T>>

getFactHandles

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

toExternalForm

public String toExternalForm()
Specified by:
toExternalForm in interface AgendaItem<T extends ModedAssertion<T>>

getObjects

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

getDeclarationValue

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

getDeclarationIds

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

isCanceled

public boolean isCanceled()
Specified by:
isCanceled in interface AgendaItem<T extends ModedAssertion<T>>

cancel

public void cancel()
Specified by:
cancel in interface AgendaItem<T extends ModedAssertion<T>>

isMatched

public boolean isMatched()
Specified by:
isMatched in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
isMatched in interface Activation<T extends ModedAssertion<T>>

setMatched

public void setMatched(boolean matched)
Specified by:
setMatched in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
setMatched in interface Activation<T extends ModedAssertion<T>>

isActive

public boolean isActive()
Specified by:
isActive in interface Activation<T extends ModedAssertion<T>>

setActive

public void setActive(boolean active)
Specified by:
setActive in interface Activation<T extends ModedAssertion<T>>

isRuleAgendaItem

public boolean isRuleAgendaItem()
Specified by:
isRuleAgendaItem in interface AgendaItem<T extends ModedAssertion<T>>
Specified by:
isRuleAgendaItem in interface Activation<T extends ModedAssertion<T>>

Drools :: Core 6.2.0.Final

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