Drools :: Core 6.0.0.Beta1

org.drools.core.common
Class BinaryHeapQueueAgendaGroup

java.lang.Object
  extended by org.drools.core.common.BinaryHeapQueueAgendaGroup
All Implemented Interfaces:
InternalAgendaGroup, org.kie.api.runtime.rule.AgendaGroup

public class BinaryHeapQueueAgendaGroup
extends Object
implements InternalAgendaGroup

AgendaGroup implementation that uses a PriorityQueue to prioritise the evaluation of added ActivationQueues. The AgendaGroup also maintains a Map of ActivationQueues for requested salience values.

See Also:
PriorityQueue, ActivationQueue

Field Summary
 
Fields inherited from interface org.drools.core.spi.AgendaGroup
MAIN
 
Constructor Summary
BinaryHeapQueueAgendaGroup()
          Construct an AgendaGroup with the given name.
BinaryHeapQueueAgendaGroup(String name, InternalRuleBase ruleBase)
           
 
Method Summary
 void add(Activation activation)
           
 void clear()
           
 boolean equals(Object object)
           
 long getActivatedForRecency()
           
 Activation[] getActivations()
           
 Activation[] getAndClear()
           
 PropagationContext getAutoFocusActivator()
           
 long getClearedForRecency()
           
 String getName()
           
 Activation getNext()
           
 int hashCode()
           
 boolean isActive()
           
 boolean isEmpty()
          Iterates a PriorityQueue removing empty entries until it finds a populated entry and return true, otherwise it returns false;
 Activation peekNext()
           
 void remove(AgendaItem agendaItem)
           
 void setActivatedForRecency(long recency)
           
 void setActive(boolean activate)
           
 void setAutoFocusActivator(PropagationContext autoFocusActivator)
           
 void setClearedForRecency(long recency)
           
 void setFocus()
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinaryHeapQueueAgendaGroup

public BinaryHeapQueueAgendaGroup()
Construct an AgendaGroup with the given name.

Parameters:
name - The name.

BinaryHeapQueueAgendaGroup

public BinaryHeapQueueAgendaGroup(String name,
                                  InternalRuleBase ruleBase)
Method Detail

getName

public String getName()
Specified by:
getName in interface org.kie.api.runtime.rule.AgendaGroup

clear

public void clear()
Specified by:
clear in interface InternalAgendaGroup
Specified by:
clear in interface org.kie.api.runtime.rule.AgendaGroup

getAndClear

public Activation[] getAndClear()
Specified by:
getAndClear in interface InternalAgendaGroup

size

public int size()
Returns:
The int total number of activations

add

public void add(Activation activation)
Specified by:
add in interface InternalAgendaGroup

getNext

public Activation getNext()
Specified by:
getNext in interface InternalAgendaGroup

peekNext

public Activation peekNext()
Specified by:
peekNext in interface InternalAgendaGroup

isActive

public boolean isActive()
Returns:
boolean value indicating if the AgendaGroup is active and thus being evaluated.

setActive

public void setActive(boolean activate)
Specified by:
setActive in interface InternalAgendaGroup

setAutoFocusActivator

public void setAutoFocusActivator(PropagationContext autoFocusActivator)

getAutoFocusActivator

public PropagationContext getAutoFocusActivator()

isEmpty

public boolean isEmpty()
Iterates a PriorityQueue removing empty entries until it finds a populated entry and return true, otherwise it returns false;

Parameters:
priorityQueue -
Returns:

getActivations

public Activation[] getActivations()
Returns:
An immutable Collection of all the activations in the AgendaGroup

toString

public String toString()
Overrides:
toString in class Object

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

setFocus

public void setFocus()
Specified by:
setFocus in interface org.kie.api.runtime.rule.AgendaGroup

remove

public void remove(AgendaItem agendaItem)
Specified by:
remove in interface InternalAgendaGroup

setActivatedForRecency

public void setActivatedForRecency(long recency)
Specified by:
setActivatedForRecency in interface InternalAgendaGroup

getActivatedForRecency

public long getActivatedForRecency()
Specified by:
getActivatedForRecency in interface InternalAgendaGroup

setClearedForRecency

public void setClearedForRecency(long recency)
Specified by:
setClearedForRecency in interface InternalAgendaGroup

getClearedForRecency

public long getClearedForRecency()
Specified by:
getClearedForRecency in interface InternalAgendaGroup

Drools :: Core 6.0.0.Beta1

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