com.novell.xsl.process
Class RuleList

java.lang.Object
  extended bycom.novell.xsl.process.RuleList

public class RuleList
extends Object

A list of rules organized for pattern matching.

The list automatically optimizes its internal storage before doing any matching. This optimization may be time consuming for a large lists, so there is a method available to force the optimization to happen up front.


Constructor Summary
RuleList()
           
 
Method Summary
 void add(Rule rule)
          Adds the specified rule to this rule list.
 void addAll(RuleList list)
          Adds to this rule list all of the rules in the specified rule list.
 void dump(PrintWriter out, int indent)
          Dumps this object to the specified output stream.
 Rule[] getRules()
          Optimizes this rule list for matching (if it isn't already optimized) and returns the optimized rules.
 void optimize()
          Optimizes this rule list for matching.
 void removeAll(RuleList list)
          Removes from this rule list all of the rules in the specified rule list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleList

public RuleList()
Method Detail

add

public void add(Rule rule)
Adds the specified rule to this rule list. This method causes this rule list to become unoptimized.

Parameters:
rule - the rule to be added

addAll

public void addAll(RuleList list)
Adds to this rule list all of the rules in the specified rule list. This method causes both rule lists to become unoptimized.

Parameters:
list - the rule list to be added

removeAll

public void removeAll(RuleList list)
Removes from this rule list all of the rules in the specified rule list. This method causes both rule lists to become unoptimized.

Parameters:
list - the rule list to be removed

getRules

public Rule[] getRules()
Optimizes this rule list for matching (if it isn't already optimized) and returns the optimized rules. The returned rules are sorted according to the rules' compareTo method. The returned array, and the rules in the array, must not be modified even though there is no enforcement mechanism.

Returns:
this rule list's optimized rules
See Also:
Rule.compareTo(java.lang.Object)

optimize

public void optimize()
Optimizes this rule list for matching.


dump

public void dump(PrintWriter out,
                 int indent)
Dumps this object to the specified output stream.

Parameters:
out - the output stream to write to
indent - number of tabs to indent