agg.xt_basis
Class RulePriority

java.lang.Object
  extended by agg.xt_basis.RulePriority

public class RulePriority
extends java.lang.Object

Rule priority is a set of rule priority of a given graph grammar. The set is backed by a hash table.


Constructor Summary
RulePriority(java.util.Enumeration<Rule> rules)
          Creates a new set of rule priorities for a given graph grammar.
RulePriority(java.util.List<Rule> rules)
           
RulePriority(java.util.Vector<Rule> rules)
           
 
Method Summary
 java.util.Hashtable<Rule,java.lang.Integer> getRulePriority()
          Returns the rule Priorities.
 java.lang.Integer getStartPriority()
          Returns the highest priority of the rule priority.
 java.util.Hashtable<java.lang.Integer,com.objectspace.jgl.HashSet> invertPriority()
          Inverts a rule priority so that the priority is the key and the value is a set.
 void setPriority(Rule rule, int p)
          Sets the priority of the specified rule
 java.lang.String toString()
          Returns the rule priority in a human readable way.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RulePriority

public RulePriority(java.util.Enumeration<Rule> rules)
Creates a new set of rule priorities for a given graph grammar.

Parameters:
rules - The rules of a graph grammar.

RulePriority

public RulePriority(java.util.List<Rule> rules)

RulePriority

public RulePriority(java.util.Vector<Rule> rules)
Method Detail

setPriority

public void setPriority(Rule rule,
                        int p)
Sets the priority of the specified rule


getRulePriority

public java.util.Hashtable<Rule,java.lang.Integer> getRulePriority()
Returns the rule Priorities. A rule is a key, a priority is a value.

Returns:
The rule priority.

getStartPriority

public java.lang.Integer getStartPriority()
Returns the highest priority of the rule priority. The highest priority means the smallest number > 0.

Returns:
The highest priority.

invertPriority

public java.util.Hashtable<java.lang.Integer,com.objectspace.jgl.HashSet> invertPriority()
Inverts a rule priority so that the priority is the key and the value is a set.

Returns:
The inverted set.

toString

public java.lang.String toString()
Returns the rule priority in a human readable way.

Overrides:
toString in class java.lang.Object
Returns:
The text.