org.gcube.data.trees.patterns
Class CutTreePattern

java.lang.Object
  extended by org.gcube.data.trees.patterns.AbstractPattern
      extended by org.gcube.data.trees.patterns.TreePattern
          extended by org.gcube.data.trees.patterns.CutTreePattern
All Implemented Interfaces:
Serializable, Pattern

public class CutTreePattern
extends TreePattern

A Pattern in which prune(Node) removes all the edges of matching nodes, not only those that are not required for matching.

This pattern minimises the amount of matching data returned by prune(Node) when the properties of the data are not required for further processing (e.g. when matching elements need only to be counted).

Author:
Fabio Simeoni
See Also:
Serialized Form

Constructor Summary
CutTreePattern(List<EdgePattern> ps)
          Creates an instance with a list of EdgePatterns.
 
Method Summary
 void prune(Node n)
          Removes all the edges of a nodes that matches the pattern, not only those that are not required for matching.
 String toString()
          
 
Methods inherited from class org.gcube.data.trees.patterns.TreePattern
equals, hashCode, matches, pattern, patterns
 
Methods inherited from class org.gcube.data.trees.patterns.AbstractPattern
idPattern, setIdPattern
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CutTreePattern

public CutTreePattern(List<EdgePattern> ps)
Creates an instance with a list of EdgePatterns.

Parameters:
ps - the patterns
Method Detail

prune

public void prune(Node n)
           throws Exception
Removes all the edges of a nodes that matches the pattern, not only those that are not required for matching.

Specified by:
prune in interface Pattern
Overrides:
prune in class TreePattern
Parameters:
n - the node.
Throws:
Exception - if the node does not match the pattern.

toString

public String toString()
Description copied from class: TreePattern

Overrides:
toString in class TreePattern


Copyright © 2013. All Rights Reserved.