org.writersforge.catalan.transform.rule
Class RuleCollection

java.lang.Object
  |
  +--org.writersforge.catalan.transform.rule.RuleCollection
All Implemented Interfaces:
Rule

public class RuleCollection
extends java.lang.Object
implements Rule

A composite Rule that manages a collection of other Rule objects. When this Rule is invoked, it will process all of its child Rule objects, rather than processing any content of its own.

Author:
jsheets

Constructor Summary
RuleCollection()
           
 
Method Summary
 void addRule(Rule rule)
          Adds another child Rule to the collection.
 void clearRules()
          Removes all Rule objects from this collection.
 int getRuleCount()
          Returns the number of child Rule objects in this collection.
 org.writersforge.bellows.Datum process(org.writersforge.bellows.Datum content)
          Applies changes to the supplied Datum content by running all the child Rule objects it contains.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleCollection

public RuleCollection()
Method Detail

process

public org.writersforge.bellows.Datum process(org.writersforge.bellows.Datum content)
Applies changes to the supplied Datum content by running all the child Rule objects it contains.

Specified by:
process in interface Rule
Parameters:
content - a Datum object to apply the Rule to
Returns:
the transformed content

addRule

public void addRule(Rule rule)
Adds another child Rule to the collection.

Parameters:
rule - new Rule to add

getRuleCount

public int getRuleCount()
Returns the number of child Rule objects in this collection.

Returns:
the total number of Rule objects

clearRules

public void clearRules()
Removes all Rule objects from this collection.