i3.dragos.gm.core
Class MultiWrapper

java.lang.Object
  extended by i3.dragos.gm.core.MultiWrapper
All Implemented Interfaces:
Wrapper

public class MultiWrapper
extends java.lang.Object
implements Wrapper

This Wrapper uses multiple other Wrappers to process any supplied argument.

The first wrapper in the array is called to wrap the original entity / class, all following wrappers each receive the output of the predecessor as argument. The output of the last wrapper in the array is then returned by this wrapper.

Author:
Thorsten Hermes <thermes@i3.informatik.rwth-aachen.de>

Constructor Summary
MultiWrapper(Wrapper[] wrappers)
          Creates a MultiWrapper.
 
Method Summary
 Wrapper getLastWrapper()
          Returns the last wrapper.
 Wrapper getWrapper(int index)
          Returns the wrapper at the given index.
 Attribute wrapAttribute(Attribute a)
          Wraps the supplied Attribute.
 Edge wrapEdge(Edge g)
          Variant of Wrapper.wrapGraphEntity(GraphEntity) to avoid casting.
 EdgeClass wrapEdgeClass(EdgeClass g)
          Variant of Wrapper.wrapGraphEntityClass(GraphEntityClass) to avoid casting.
 Graph wrapGraph(Graph g)
          Variant of Wrapper.wrapGraphEntity(GraphEntity) to avoid casting.
 GraphClass wrapGraphClass(GraphClass g)
          Variant of Wrapper.wrapGraphEntityClass(GraphEntityClass) to avoid casting.
 GraphEntity wrapGraphEntity(GraphEntity g)
          Wraps the supplied GraphEntity.
 GraphEntityClass wrapGraphEntityClass(GraphEntityClass g)
          Wraps the supplied GraphEntityClass.
 Node wrapNode(Node g)
          Variant of Wrapper.wrapGraphEntity(GraphEntity) to avoid casting.
 NodeClass wrapNodeClass(NodeClass g)
          Variant of Wrapper.wrapGraphEntityClass(GraphEntityClass) to avoid casting.
 Relation wrapRelation(Relation g)
          Variant of Wrapper.wrapGraphEntity(GraphEntity) to avoid casting.
 RelationClass wrapRelationClass(RelationClass g)
          Variant of Wrapper.wrapGraphEntityClass(GraphEntityClass) to avoid casting.
 RelationEnd wrapRelationEnd(RelationEnd g)
          Variant of Wrapper.wrapGraphEntity(GraphEntity) to avoid casting.
 RelationEndClass wrapRelationEndClass(RelationEndClass g)
          Variant of Wrapper.wrapGraphEntityClass(GraphEntityClass) to avoid casting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiWrapper

public MultiWrapper(Wrapper[] wrappers)
Creates a MultiWrapper.

Parameters:
wrappers - An array of wrappers (which is copied, not referenced), may have a length of 0, but no null elements.
Method Detail

getLastWrapper

public Wrapper getLastWrapper()
Returns the last wrapper.

Returns:
the last of the wrappers.

getWrapper

public Wrapper getWrapper(int index)
Returns the wrapper at the given index.

Parameters:
index - The index of the wrapper that should be returned.
Returns:
the wrapper at the given index.

wrapGraphEntity

public GraphEntity wrapGraphEntity(GraphEntity g)
                            throws DragosException
Wraps the supplied GraphEntity. The type of the entity must be left unchanged, e.g. an Edge must only be wrapped in another Edge, not in a Node.

Specified by:
wrapGraphEntity in interface Wrapper
Parameters:
g - The GraphEntity to wrap, must not be null
Returns:
A GraphEntity of the same type, wrapping the supplied entity in zero or more layers.
Throws:
DragosException - in case of errors during wrapping.

wrapGraphEntityClass

public GraphEntityClass wrapGraphEntityClass(GraphEntityClass g)
                                      throws DragosException
Wraps the supplied GraphEntityClass. The type of the entity must be left unchanged, e.g. an EdgeClass must only be wrapped in another EdgeClass, not in a NodeClass.

Specified by:
wrapGraphEntityClass in interface Wrapper
Parameters:
g - The GraphEntityClass to wrap, must not be null
Returns:
A GraphEntityClass of the same type, wrapping the supplied class in zero or more layers.
Throws:
DragosException - in case of errors during wrapping.

wrapEdge

public Edge wrapEdge(Edge g)
              throws DragosException
Variant of Wrapper.wrapGraphEntity(GraphEntity) to avoid casting.

Specified by:
wrapEdge in interface Wrapper
Parameters:
g - see Wrapper.wrapGraphEntity(GraphEntity) for details
Returns:
see Wrapper.wrapGraphEntity(GraphEntity) for details
Throws:
DragosException - in case of errors during wrapping.

wrapEdgeClass

public EdgeClass wrapEdgeClass(EdgeClass g)
                        throws DragosException
Variant of Wrapper.wrapGraphEntityClass(GraphEntityClass) to avoid casting.

Specified by:
wrapEdgeClass in interface Wrapper
Parameters:
g - see Wrapper.wrapGraphEntity(GraphEntity) for details
Returns:
see Wrapper.wrapGraphEntityClass(GraphEntityClass) for details
Throws:
DragosException - in case of errors during wrapping.

wrapGraph

public Graph wrapGraph(Graph g)
                throws DragosException
Variant of Wrapper.wrapGraphEntity(GraphEntity) to avoid casting.

Specified by:
wrapGraph in interface Wrapper
Parameters:
g - see Wrapper.wrapGraphEntity(GraphEntity) for details
Returns:
see Wrapper.wrapGraphEntity(GraphEntity) for details
Throws:
DragosException - in case of errors during wrapping.

wrapGraphClass

public GraphClass wrapGraphClass(GraphClass g)
                          throws DragosException
Variant of Wrapper.wrapGraphEntityClass(GraphEntityClass) to avoid casting.

Specified by:
wrapGraphClass in interface Wrapper
Parameters:
g - see Wrapper.wrapGraphEntityClass(GraphEntityClass) for details
Returns:
see Wrapper.wrapGraphEntityClass(GraphEntityClass) for details
Throws:
DragosException - in case of errors during wrapping.

wrapNode

public Node wrapNode(Node g)
              throws DragosException
Variant of Wrapper.wrapGraphEntity(GraphEntity) to avoid casting.

Specified by:
wrapNode in interface Wrapper
Parameters:
g - see Wrapper.wrapGraphEntity(GraphEntity) for details
Returns:
see Wrapper.wrapGraphEntity(GraphEntity) for details
Throws:
DragosException - in case of errors during wrapping.

wrapNodeClass

public NodeClass wrapNodeClass(NodeClass g)
                        throws DragosException
Variant of Wrapper.wrapGraphEntityClass(GraphEntityClass) to avoid casting.

Specified by:
wrapNodeClass in interface Wrapper
Parameters:
g - see Wrapper.wrapGraphEntityClass(GraphEntityClass) for details
Returns:
see Wrapper.wrapGraphEntityClass(GraphEntityClass) for details
Throws:
DragosException - in case of errors during wrapping.

wrapRelation

public Relation wrapRelation(Relation g)
                      throws DragosException
Variant of Wrapper.wrapGraphEntity(GraphEntity) to avoid casting.

Specified by:
wrapRelation in interface Wrapper
Parameters:
g - see Wrapper.wrapGraphEntity(GraphEntity) for details
Returns:
see Wrapper.wrapGraphEntity(GraphEntity) for details
Throws:
DragosException - in case of errors during wrapping.

wrapRelationClass

public RelationClass wrapRelationClass(RelationClass g)
                                throws DragosException
Variant of Wrapper.wrapGraphEntityClass(GraphEntityClass) to avoid casting.

Specified by:
wrapRelationClass in interface Wrapper
Parameters:
g - see Wrapper.wrapGraphEntityClass(GraphEntityClass) for details
Returns:
see Wrapper.wrapGraphEntityClass(GraphEntityClass) for details
Throws:
DragosException - in case of errors during wrapping.

wrapRelationEnd

public RelationEnd wrapRelationEnd(RelationEnd g)
                            throws DragosException
Variant of Wrapper.wrapGraphEntity(GraphEntity) to avoid casting.

Specified by:
wrapRelationEnd in interface Wrapper
Parameters:
g - see Wrapper.wrapGraphEntity(GraphEntity) for details
Returns:
see Wrapper.wrapGraphEntity(GraphEntity) for details
Throws:
DragosException - in case of errors during wrapping.

wrapRelationEndClass

public RelationEndClass wrapRelationEndClass(RelationEndClass g)
                                      throws DragosException
Variant of Wrapper.wrapGraphEntityClass(GraphEntityClass) to avoid casting.

Specified by:
wrapRelationEndClass in interface Wrapper
Parameters:
g - see Wrapper.wrapGraphEntityClass(GraphEntityClass) for details
Returns:
see Wrapper.wrapGraphEntityClass(GraphEntityClass) for details
Throws:
DragosException - in case of errors during wrapping.

wrapAttribute

public Attribute wrapAttribute(Attribute a)
                        throws DragosException
Wraps the supplied Attribute.

Specified by:
wrapAttribute in interface Wrapper
Parameters:
a - The Attribute to wrap, must not be null
Returns:
An Attribute, wrapping the original Attribute in zero or more layers.
Throws:
DragosException - in case of errors during wrapping.


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.