ch.elca.dependency.graph
Class Aggregator

java.lang.Object
  |
  +--ch.elca.dependency.graph.AbstractGraphProcessor
        |
        +--ch.elca.dependency.graph.Aggregator
All Implemented Interfaces:
GraphProcessor

public class Aggregator
extends AbstractGraphProcessor

This class is responsible for aggregating nodes in a graph accordingly to a regexp.

Version:
1.0-beta
Author:
Pawel Kowalski

Field Summary
protected  boolean m_noRegexp
          A flag, telling whether the specified regular expression could be successfully used for building a RE Program.
protected  java.util.regex.Pattern m_regexp
          A precompiled regexp matcher.
protected  java.lang.String m_regexpString
          A regexp String associated with this Aggregator.
 
Fields inherited from class ch.elca.dependency.graph.AbstractGraphProcessor
m_name
 
Constructor Summary
Aggregator()
          Creates a new Aggregator instance.
Aggregator(java.lang.String name, java.lang.String regexpString)
          Creates a new Aggregator with a name and a String used to be used for building a RE (regular expression program).
 
Method Summary
 java.util.regex.Pattern getPattern()
          Returns the Pattern (Regexp) used by this Aggregator.
 java.lang.String getRegexp()
          Get the regexp used to aggregate nodes.
 Graph process(Graph graph)
          Aggregate nodes accordingl to a regexp.
 void setRegexp(java.lang.String regexpString)
          Set a regular expression for aggregating nodes.
 
Methods inherited from class ch.elca.dependency.graph.AbstractGraphProcessor
getName, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_regexpString

protected java.lang.String m_regexpString
A regexp String associated with this Aggregator.


m_regexp

protected java.util.regex.Pattern m_regexp
A precompiled regexp matcher.


m_noRegexp

protected boolean m_noRegexp
A flag, telling whether the specified regular expression could be successfully used for building a RE Program.

Constructor Detail

Aggregator

public Aggregator()
Creates a new Aggregator instance.


Aggregator

public Aggregator(java.lang.String name,
                  java.lang.String regexpString)
Creates a new Aggregator with a name and a String used to be used for building a RE (regular expression program).

Parameters:
name - a String value
regexpString - a String value
Method Detail

setRegexp

public void setRegexp(java.lang.String regexpString)
Set a regular expression for aggregating nodes.

Parameters:
regexpString - a String value

getRegexp

public java.lang.String getRegexp()
Get the regexp used to aggregate nodes.

Returns:
a String value

getPattern

public java.util.regex.Pattern getPattern()
Returns the Pattern (Regexp) used by this Aggregator.

Returns:
a Pattern value

process

public Graph process(Graph graph)
Aggregate nodes accordingl to a regexp. The aggregate node will have the name associated with this class. This is an Implementation of the abstract method inherited from the AbstractGraphProcessor.

Parameters:
graph - a Graph value
Returns:
a Graph value
See Also:
GraphUtils.copy(Graph)


Copyright © 2003 ELCA Informatique SA. All Rights Reserved.