tip.node
Class GuardedSubTypeFilter<T extends NodeInterface>

java.lang.Object
  extended by tip.node.GuardedSubTypeFilter<T>
Type Parameters:
T - the supertype for which the GuardedSubTypeFilter can accept nodes.
All Implemented Interfaces:
NodeFilter<T>

public class GuardedSubTypeFilter<T extends NodeInterface>
extends Object
implements NodeFilter<T>

GuardedSubTypeFilter implements the NodeFilter interface by accepting all nodes that are subtypes of the first class and guarding on all nodes that are subtypes of the second class given in the constructor.

Author:
Johnni Winther, jw@brics.dk

Constructor Summary
GuardedSubTypeFilter(Class<T> classT, Class<? extends NodeInterface> guardClass)
          Creates a SubTypeFilter using subtype relation of classT as filtering criterion and subtype relation of guardClass as guarding criterion.
 
Method Summary
 boolean accept(Node node)
          Returns true if node is a subtype of the class given in the constructor.
 boolean guard(Node node)
          Returns true if node guards further processesing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GuardedSubTypeFilter

public GuardedSubTypeFilter(Class<T> classT,
                            Class<? extends NodeInterface> guardClass)
Creates a SubTypeFilter using subtype relation of classT as filtering criterion and subtype relation of guardClass as guarding criterion.

Parameters:
classT - the class used for filtering
guardClass - the class used for guarding
Method Detail

accept

public boolean accept(Node node)
Returns true if node is a subtype of the class given in the constructor.

Specified by:
accept in interface NodeFilter<T extends NodeInterface>
Parameters:
node - the node in question
Returns:
true if node is a subtype of the class given in the constructor

guard

public boolean guard(Node node)
Returns true if node guards further processesing.

Specified by:
guard in interface NodeFilter<T extends NodeInterface>
Parameters:
node - the node in question
Returns:
true if node guards further processesing.