org.drools.common
Class BinaryHeapQueueAgendaGroup
java.lang.Object
org.drools.common.BinaryHeapQueueAgendaGroup
- All Implemented Interfaces:
- Externalizable, Serializable, InternalAgendaGroup, org.drools.runtime.rule.AgendaGroup
public class BinaryHeapQueueAgendaGroup
- extends Object
- implements InternalAgendaGroup
AgendaGroup
implementation that uses a PriorityQueue
to prioritise the evaluation of added
ActivationQueue
s. The AgendaGroup
also maintains a Map
of ActivationQueues
for requested salience values.
- See Also:
PriorityQueue
,
ActivationQueue
,
Serialized Form
BinaryHeapQueueAgendaGroup
public BinaryHeapQueueAgendaGroup()
- Construct an
AgendaGroup
with the given name.
- Parameters:
name
- The name.
BinaryHeapQueueAgendaGroup
public BinaryHeapQueueAgendaGroup(String name,
InternalRuleBase ruleBase)
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
getName
public String getName()
- Specified by:
getName
in interface org.drools.runtime.rule.AgendaGroup
clear
public void clear()
- Specified by:
clear
in interface InternalAgendaGroup
- Specified by:
clear
in interface org.drools.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
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
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
equal
public boolean equal(Object object)
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
setFocus
public void setFocus()
- Specified by:
setFocus
in interface org.drools.runtime.rule.AgendaGroup
remove
public void remove(AgendaItem agendaItem)
- Specified by:
remove
in interface InternalAgendaGroup
Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.