ch.elca.dependency.graph
Class LayerOrder

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

public class LayerOrder
extends AbstractGraphProcessor
implements LayeringListener

This class represents Layers within a graph. It's creation is based on the perspectives config. It can be used to layer a graph and signalize violations of the layering model.

Version:
1.0-beta
Author:
Pawel Kowalski

Field Summary
static java.lang.String LAYER_NUMBER_KEY
          Key to store and retrieve the LayerNumber property.
 
Fields inherited from class ch.elca.dependency.graph.AbstractGraphProcessor
m_name
 
Constructor Summary
LayerOrder()
          Creates a new LayerOrder instance.
LayerOrder(java.lang.String name)
          Creates a new LayerOrder instance.
 
Method Summary
 void addLayer(Layer layer)
          Add a Layer to this LayerOrder.
 void addLayeringListener(LayeringListener listener)
          Add a LayeringListener which will receive LayeringEvents.
 void layeringViolated(LayeringEvent event)
          Handle a event fired when a violation of the layering is discovered.
 Graph process(Graph graph)
          Process a graph according to this LayerOrder.
 void removeLayeringListener(LayeringListener listener)
          Remove a LayeringListener from the collection of Listeners receiving LayeringEvents.
 void resetLayers()
          Delete all Layers withing this LayerOrder.
 
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

LAYER_NUMBER_KEY

public static final java.lang.String LAYER_NUMBER_KEY
Key to store and retrieve the LayerNumber property.

See Also:
Constant Field Values
Constructor Detail

LayerOrder

public LayerOrder()
Creates a new LayerOrder instance.


LayerOrder

public LayerOrder(java.lang.String name)
Creates a new LayerOrder instance.

Parameters:
name - a String value
Method Detail

addLayer

public void addLayer(Layer layer)
Add a Layer to this LayerOrder.

Parameters:
layer - a Layer value

resetLayers

public void resetLayers()
Delete all Layers withing this LayerOrder.


process

public Graph process(Graph graph)
Process a graph according to this LayerOrder. This processing uncovers layering violations. Each time a violation of the layering is discovered, an instance of this class fires a LayeringEvent (with the help of LayeringEventSupport).

Specified by:
process in interface GraphProcessor
Parameters:
graph - a Graph value
Returns:
a Graph value
See Also:
GraphUtils.copy(Graph)

layeringViolated

public void layeringViolated(LayeringEvent event)
Handle a event fired when a violation of the layering is discovered.

Specified by:
layeringViolated in interface LayeringListener
Parameters:
event - a LayeringEvent value

addLayeringListener

public void addLayeringListener(LayeringListener listener)
Add a LayeringListener which will receive LayeringEvents.

Parameters:
listener - a LayeringListener value

removeLayeringListener

public void removeLayeringListener(LayeringListener listener)
Remove a LayeringListener from the collection of Listeners receiving LayeringEvents.

Parameters:
listener - a LayeringListener value


Copyright © 2003 ELCA Informatique SA. All Rights Reserved.