org.drools.common
Class ArrayAgendaGroup

java.lang.Object
  extended by org.drools.common.ArrayAgendaGroup
All Implemented Interfaces:
java.io.Serializable, InternalAgendaGroup, AgendaGroup

public class ArrayAgendaGroup
extends java.lang.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.

Author:
Mark Proctor, Bob McWhirter
See Also:
PriorityQueue, ActivationQueue, Serialized Form

Field Summary
 
Fields inherited from interface org.drools.spi.AgendaGroup
MAIN
 
Constructor Summary
ArrayAgendaGroup(java.lang.String name, InternalRuleBase ruleBase)
          Construct an AgendaGroup with the given name.
 
Method Summary
 void add(Activation activation)
           
 void clear()
           
 boolean equal(java.lang.Object object)
           
 Activation[] getActivations()
           
 java.lang.String getName()
           
 Activation getNext()
           
 Activation[] getQueue()
           
 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;
 void setActive(boolean activate)
           
 int size()
          The total number of activations in this group
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayAgendaGroup

public ArrayAgendaGroup(java.lang.String name,
                        InternalRuleBase ruleBase)
Construct an AgendaGroup with the given name.

Parameters:
name - The name.
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface AgendaGroup
Returns:
The AgendaGroup name

clear

public void clear()
Specified by:
clear in interface InternalAgendaGroup

size

public int size()
Description copied from interface: AgendaGroup
The total number of activations in this group

Specified by:
size in interface AgendaGroup
Returns:
int value for the 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()
Specified by:
isActive in interface AgendaGroup

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;

Specified by:
isEmpty in interface AgendaGroup
Parameters:
priorityQueue -
Returns:

getActivations

public Activation[] getActivations()
Specified by:
getActivations in interface AgendaGroup
Returns:
An array of all the activations in the AgendaGroup

getQueue

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equal

public boolean equal(java.lang.Object object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object