Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jeops.conflict
Class PriorityConflictSet  view PriorityConflictSet download PriorityConflictSet.java

java.lang.Object
  extended byjeops.conflict.AbstractConflictSet
      extended byjeops.conflict.PriorityConflictSet
All Implemented Interfaces:
ConflictSet

public class PriorityConflictSet
extends AbstractConflictSet

A conflict set whose conflict resolution policy is one that rules defined first in the rule base have a higher priority over the ones defined below it.

Version:
0.01 14 Apr 2000

Field Summary
private  java.util.Vector fireableRules
          The vector where the fireable rules are stored.
private  int size
          The number of elements in this conflict set.
 
Fields inherited from class jeops.conflict.AbstractConflictSet
debug, listeners
 
Constructor Summary
PriorityConflictSet()
          Class constructor.
 
Method Summary
private  void ensureFireableRulesCapacity(int size)
          Auxiliar method that ensures that the fireable rules vector has as many elements as the given integer.
 void flush()
          Removes all rules from this conflict set, as well as cleaning any history that might have been stored.
 void insertElement(ConflictSetElement element)
          Inserts a rule instantiation.
 boolean isEmpty()
          Checks whether this set has any elements.
 ConflictSetElement nextElement()
          Returns the next rule to be fired.
 void removeElementsWith(java.lang.Object obj)
          Remove all elements from this set that uses the given object in its instantiations.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class jeops.conflict.AbstractConflictSet
addInternalConflictSetListener, elementAdded, elementRemoved, removeElementsWith_1D, removeElementsWith_2D, removeInternalConflictSetListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fireableRules

private java.util.Vector fireableRules
The vector where the fireable rules are stored. It's actually a vector of vectors, to simulate a bidimensional matrix: the lines represent the rules and the columns will have their instantiations.


size

private int size
The number of elements in this conflict set.

Constructor Detail

PriorityConflictSet

public PriorityConflictSet()
Class constructor.

Method Detail

ensureFireableRulesCapacity

private void ensureFireableRulesCapacity(int size)
Auxiliar method that ensures that the fireable rules vector has as many elements as the given integer.


flush

public void flush()
Removes all rules from this conflict set, as well as cleaning any history that might have been stored.


insertElement

public void insertElement(ConflictSetElement element)
Inserts a rule instantiation.


isEmpty

public boolean isEmpty()
Checks whether this set has any elements.


nextElement

public ConflictSetElement nextElement()
                               throws NoMoreElementsException
Returns the next rule to be fired.


removeElementsWith

public void removeElementsWith(java.lang.Object obj)
Remove all elements from this set that uses the given object in its instantiations.


toString

public java.lang.String toString()
Returns a string representation of this object. Useful for debugging.