tip.node
Class SubTypeFilter<T extends NodeInterface>

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

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

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

Author:
Johnni Winther, jw@brics.dk

Constructor Summary
SubTypeFilter(Class<T> classT)
          Creates a SubTypeFilter using subtype relation of classT as filtering 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

SubTypeFilter

public SubTypeFilter(Class<T> classT)
Creates a SubTypeFilter using subtype relation of classT as filtering criterion.

Parameters:
classT - the class used for filtering
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. The implementation returns false on all nodes, effectively disabling guard functionality.

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