org.gcube.data.trees.patterns
Class AnyPattern

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

public class AnyPattern
extends AbstractPattern

A pattern that matches all Nodes.

Author:
Fabio Simeoni
See Also:
Serialized Form

Constructor Summary
AnyPattern()
           
 
Method Summary
 boolean matches(Node n)
          Indicates whether a node matches a pattern.
 void prune(Node n)
          Prunes a node of all the descendants that are not required to match the pattern.
 String toString()
          
 
Methods inherited from class org.gcube.data.trees.patterns.AbstractPattern
equals, hashCode, idPattern, setIdPattern
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnyPattern

public AnyPattern()
Method Detail

matches

public boolean matches(Node n)
Indicates whether a node matches a pattern.

Specified by:
matches in interface Pattern
Overrides:
matches in class AbstractPattern
Parameters:
n - the node.
Returns:
true if it does, false otherwise.

prune

public void prune(Node n)
           throws Exception
Prunes a node of all the descendants that are not required to match the pattern.

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

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.