org.eclipse.emf.henshin.model
Interface MappingList

All Superinterfaces:
Collection<Mapping>, EList<Mapping>, Iterable<Mapping>, List<Mapping>
All Known Implementing Classes:
MappingContainmentListImpl, MappingListImpl

public interface MappingList
extends EList<Mapping>

Interface for Mapping lists. Provides helper methods.


Method Summary
 Mapping add(Attribute origin, Attribute image)
          Create and add a new mapping between the origin and image attribute.
 void add(Edge origin, Edge image)
          Create and add a new mapping between the origin and image edge.
<E extends GraphElement>
void
add(E origin, E image)
          Create a mapping between two graph elements.
 Mapping add(Node origin, Node image)
          Create and add a new mapping between the origin and image node.
 Mapping get(Node origin, Node image)
          Find a mapping for a given node origin and image.
 Attribute getImage(Attribute origin, Graph imageGraph)
          Get the image of an attribute in a given target graph.
 Edge getImage(Edge origin, Graph imageGraph)
          Get the image of an edge in a given target graph.
<E extends GraphElement>
E
getImage(E origin, Graph imageGraph)
          Get the image of an untyped object in a target graph.
 Node getImage(Node origin, Graph imageGraph)
          Get the image of a node in a given target graph.
 Attribute getOrigin(Attribute image)
          Get the origin of an attribute.
<E extends GraphElement>
E
getOrigin(E object)
          Get the origin of an untyped object.
 Edge getOrigin(Edge image)
          Find the origin of an edge.
 Node getOrigin(Node image)
          Find the origin of a node.
 boolean isOnto(Graph imageGraph)
          Check whether this map is 'onto' (surjective).
 Mapping remove(Attribute origin, Attribute image)
          Remove a mapping between the given origin and image attribute.
 void remove(Edge origin, Edge image)
          Remove a mapping between the given origin and image edge.
<E extends GraphElement>
void
remove(E origin, E image)
          Remove a mapping between two graph elements.
 Mapping remove(Node origin, Node image)
          Remove a mapping between the given origin and image node.
 
Methods inherited from interface org.eclipse.emf.common.util.EList
move, move
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Method Detail

get

Mapping get(Node origin,
            Node image)
Find a mapping for a given node origin and image.

Parameters:
origin - Node origin.
image - Node image.
Returns:
The mapping if found, otherwise null.

add

Mapping add(Node origin,
            Node image)
Create and add a new mapping between the origin and image node.

Parameters:
origin - Origin node.
image - Image node.
Returns:
The newly created mapping.

add

void add(Edge origin,
         Edge image)
Create and add a new mapping between the origin and image edge. This maps source to source and target to target.

Parameters:
origin - Origin edge.
image - Image edge.

add

Mapping add(Attribute origin,
            Attribute image)
Create and add a new mapping between the origin and image attribute.

Parameters:
origin - Origin attribute.
image - Image attribute.
Returns:
The newly created mapping.

add

<E extends GraphElement> void add(E origin,
                                  E image)
Create a mapping between two graph elements.

Parameters:
origin - Origin element.
image - Target element.

remove

Mapping remove(Node origin,
               Node image)
Remove a mapping between the given origin and image node.

Parameters:
origin - Origin node.
image - Image node.
Returns:
The removed mapping.

remove

void remove(Edge origin,
            Edge image)
Remove a mapping between the given origin and image edge.

Parameters:
origin - Origin edge.
image - Image edge.

remove

Mapping remove(Attribute origin,
               Attribute image)
Remove a mapping between the given origin and image attribute.

Parameters:
origin - Origin attribute.
image - Image attribute.
Returns:
The removed mapping.

remove

<E extends GraphElement> void remove(E origin,
                                     E image)
Remove a mapping between two graph elements.

Parameters:
origin - Origin element.
image - Target element.

getOrigin

Node getOrigin(Node image)
Find the origin of a node.

Parameters:
image - Image node.
Returns:
The origin of the node.

getOrigin

Edge getOrigin(Edge image)
Find the origin of an edge.

Parameters:
image - Image edge.
Returns:
Edge image.

getOrigin

Attribute getOrigin(Attribute image)
Get the origin of an attribute.

Parameters:
image - Image attribute.
Returns:
The origin attribute.

getOrigin

<E extends GraphElement> E getOrigin(E object)
Get the origin of an untyped object. This delegates to getOrigin(Node), getOrigin(Edge) or getOrigin(Attribute). It throws an IllegalArgumentException if the type of the object is unknown.

Parameters:
object - Image.
Returns:
The origin.

getImage

Node getImage(Node origin,
              Graph imageGraph)
Get the image of a node in a given target graph.

Parameters:
origin - Origin node.
imageGraph - Image graph.
Returns:
The image of the node.

getImage

Edge getImage(Edge origin,
              Graph imageGraph)
Get the image of an edge in a given target graph.

Parameters:
origin - Origin edge.
imageGraph - Image graph.
Returns:
Edge image.

getImage

Attribute getImage(Attribute origin,
                   Graph imageGraph)
Get the image of an attribute in a given target graph.

Parameters:
origin - Origin attribute.
imageGraph - Image graph.
Returns:
The image attribute.

getImage

<E extends GraphElement> E getImage(E origin,
                                    Graph imageGraph)
Get the image of an untyped object in a target graph. This delegates to #getImage(Node), #getImage(Edge) or #getImage(Attribute). It throws an IllegalArgumentException if the type of the object is unknown.

Parameters:
origin - Origin.
imageGraph - Image graph.
Returns:
The image.

isOnto

boolean isOnto(Graph imageGraph)
Check whether this map is 'onto' (surjective). This also checks whether the types of the mapped nodes and edge are strictly the same, and whether the attribute values are the same too.

Parameters:
imageGraph - The image graph.
Returns:
true if the map is onto.