org.eclipse.emf.henshin.model.impl
Class MappingContainmentListImpl

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by org.eclipse.emf.common.util.AbstractEList<E>
              extended by org.eclipse.emf.common.util.BasicEList<E>
                  extended by org.eclipse.emf.common.notify.impl.NotifyingListImpl<E>
                      extended by org.eclipse.emf.ecore.util.NotifyingInternalEListImpl<E>
                          extended by org.eclipse.emf.ecore.util.EcoreEList<E>
                              extended by org.eclipse.emf.ecore.util.EObjectEList<E>
                                  extended by org.eclipse.emf.ecore.util.EObjectContainmentEList<Mapping>
                                      extended by org.eclipse.emf.henshin.model.impl.MappingContainmentListImpl
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Mapping>, Collection<Mapping>, List<Mapping>, RandomAccess, NotifyingList<Mapping>, EList<Mapping>, EStructuralFeature.Setting, InternalEList<Mapping>, InternalEList.Unsettable<Mapping>, MappingList

public class MappingContainmentListImpl
extends EObjectContainmentEList<Mapping>
implements MappingList

An implementation of the MappingList interface.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.util.EObjectContainmentEList
EObjectContainmentEList.Resolving<E>, EObjectContainmentEList.Unsettable<E>
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.util.EcoreEList
EcoreEList.Dynamic<E>, EcoreEList.Generic<E>, EcoreEList.UnmodifiableEList<E>
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.util.BasicEList
BasicEList.BasicIndexOutOfBoundsException, BasicEList.EIterator<E1>, BasicEList.EListIterator<E1>, BasicEList.FastCompare<E>, BasicEList.NonResolvingEIterator<E1>, BasicEList.NonResolvingEListIterator<E1>
 
Field Summary
 
Fields inherited from class org.eclipse.emf.ecore.util.EObjectEList
featureID
 
Fields inherited from class org.eclipse.emf.ecore.util.EcoreEList
dataClass, owner
 
Fields inherited from class org.eclipse.emf.common.util.BasicEList
data, size
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
MappingContainmentListImpl(InternalEObject owner, int featureID)
          Default constructor.
 
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 image)
          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 class org.eclipse.emf.ecore.util.EObjectContainmentEList
hasInverse, hasNavigableInverse, isContainment
 
Methods inherited from class org.eclipse.emf.ecore.util.EObjectEList
canContainNull, getFeatureID, isEObject, isUnique, resolve, useEquals
 
Methods inherited from class org.eclipse.emf.ecore.util.EcoreEList
contains, createNotification, createNotification, dispatchNotification, get, getEObject, getEStructuralFeature, getFeature, getFeatureType, getInverseEReference, getInverseFeatureClass, getInverseFeatureID, getNotifier, hasInstanceClass, hasManyInverse, hasProxies, indexOf, inverseAdd, inverseRemove, isInstance, isNotificationRequired, isSet, lastIndexOf, newData, resolve, resolve, resolveProxy, set, toArray, toArray, unset, validate
 
Methods inherited from class org.eclipse.emf.ecore.util.NotifyingInternalEListImpl
basicContains, basicContainsAll, basicIndexOf, basicIterator, basicLastIndexOf, basicList, basicListIterator, basicListIterator, basicToArray, basicToArray
 
Methods inherited from class org.eclipse.emf.common.notify.impl.NotifyingListImpl
addAllUnique, addAllUnique, addAllUnique, addAllUnique, addUnique, addUnique, basicAdd, basicRemove, basicSet, clear, createNotification, createNotificationChain, doAddAllUnique, doAddAllUnique, doAddAllUnique, doAddAllUnique, doAddUnique, doAddUnique, doClear, doMove, doRemove, doRemoveAll, doSetUnique, getFeatureID, hasShadow, move, remove, removeAll, setUnique, shadowAdd, shadowRemove, shadowSet
 
Methods inherited from class org.eclipse.emf.common.util.BasicEList
assign, basicGet, clone, data, get, grow, isEmpty, primitiveGet, setData, shrink, size
 
Methods inherited from class org.eclipse.emf.common.util.AbstractEList
add, add, addAll, addAll, didAdd, didChange, didClear, didMove, didRemove, didSet, equalObjects, equals, getDuplicates, getNonDuplicates, hashCode, iterator, listIterator, listIterator, move, remove, retainAll, set, toString
 
Methods inherited from class java.util.AbstractList
removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
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
 
Methods inherited from interface org.eclipse.emf.ecore.util.InternalEList
addAllUnique, addAllUnique, addUnique, addUnique, basicAdd, basicContains, basicContainsAll, basicGet, basicIndexOf, basicIterator, basicLastIndexOf, basicList, basicListIterator, basicListIterator, basicRemove, basicToArray, basicToArray, setUnique
 

Constructor Detail

MappingContainmentListImpl

public MappingContainmentListImpl(InternalEObject owner,
                                  int featureID)
Default constructor.

Parameters:
owner - Owner of this mapping list.
featureID - Feature ID.
Method Detail

get

public Mapping get(Node origin,
                   Node image)
Description copied from interface: MappingList
Find a mapping for a given node origin and image.

Specified by:
get in interface MappingList
Parameters:
origin - Node origin.
image - Node image.
Returns:
The mapping if found, otherwise null.

add

public Mapping add(Node origin,
                   Node image)
Description copied from interface: MappingList
Create and add a new mapping between the origin and image node.

Specified by:
add in interface MappingList
Parameters:
origin - Origin node.
image - Image node.
Returns:
The newly created mapping.

add

public void add(Edge origin,
                Edge image)
Description copied from interface: MappingList
Create and add a new mapping between the origin and image edge. This maps source to source and target to target.

Specified by:
add in interface MappingList
Parameters:
origin - Origin edge.
image - Image edge.

add

public Mapping add(Attribute origin,
                   Attribute image)
Description copied from interface: MappingList
Create and add a new mapping between the origin and image attribute.

Specified by:
add in interface MappingList
Parameters:
origin - Origin attribute.
image - Image attribute.
Returns:
The newly created mapping.

add

public <E extends GraphElement> void add(E origin,
                                         E image)
Description copied from interface: MappingList
Create a mapping between two graph elements.

Specified by:
add in interface MappingList
Parameters:
origin - Origin element.
image - Target element.

remove

public Mapping remove(Node origin,
                      Node image)
Description copied from interface: MappingList
Remove a mapping between the given origin and image node.

Specified by:
remove in interface MappingList
Parameters:
origin - Origin node.
image - Image node.
Returns:
The removed mapping.

remove

public void remove(Edge origin,
                   Edge image)
Description copied from interface: MappingList
Remove a mapping between the given origin and image edge.

Specified by:
remove in interface MappingList
Parameters:
origin - Origin edge.
image - Image edge.

remove

public Mapping remove(Attribute origin,
                      Attribute image)
Description copied from interface: MappingList
Remove a mapping between the given origin and image attribute.

Specified by:
remove in interface MappingList
Parameters:
origin - Origin attribute.
image - Image attribute.
Returns:
The removed mapping.

remove

public <E extends GraphElement> void remove(E origin,
                                            E image)
Description copied from interface: MappingList
Remove a mapping between two graph elements.

Specified by:
remove in interface MappingList
Parameters:
origin - Origin element.
image - Target element.

getImage

public Node getImage(Node origin,
                     Graph imageGraph)
Description copied from interface: MappingList
Get the image of a node in a given target graph.

Specified by:
getImage in interface MappingList
Parameters:
origin - Origin node.
imageGraph - Image graph.
Returns:
The image of the node.

getOrigin

public Node getOrigin(Node image)
Description copied from interface: MappingList
Find the origin of a node.

Specified by:
getOrigin in interface MappingList
Parameters:
image - Image node.
Returns:
The origin of the node.

getImage

public Edge getImage(Edge origin,
                     Graph imageGraph)
Description copied from interface: MappingList
Get the image of an edge in a given target graph.

Specified by:
getImage in interface MappingList
Parameters:
origin - Origin edge.
imageGraph - Image graph.
Returns:
Edge image.

getOrigin

public Edge getOrigin(Edge image)
Description copied from interface: MappingList
Find the origin of an edge.

Specified by:
getOrigin in interface MappingList
Parameters:
image - Image edge.
Returns:
Edge image.

getImage

public Attribute getImage(Attribute origin,
                          Graph imageGraph)
Description copied from interface: MappingList
Get the image of an attribute in a given target graph.

Specified by:
getImage in interface MappingList
Parameters:
origin - Origin attribute.
imageGraph - Image graph.
Returns:
The image attribute.

getOrigin

public Attribute getOrigin(Attribute image)
Description copied from interface: MappingList
Get the origin of an attribute.

Specified by:
getOrigin in interface MappingList
Parameters:
image - Image attribute.
Returns:
The origin attribute.

getOrigin

public <E extends GraphElement> E getOrigin(E image)
Description copied from interface: MappingList
Get the origin of an untyped object. This delegates to MappingList.getOrigin(Node), MappingList.getOrigin(Edge) or MappingList.getOrigin(Attribute). It throws an IllegalArgumentException if the type of the object is unknown.

Specified by:
getOrigin in interface MappingList
Parameters:
image - Image.
Returns:
The origin.

getImage

public <E extends GraphElement> E getImage(E origin,
                                           Graph imageGraph)
Description copied from interface: MappingList
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.

Specified by:
getImage in interface MappingList
Parameters:
origin - Origin.
imageGraph - Image graph.
Returns:
The image.

isOnto

public boolean isOnto(Graph imageGraph)
Description copied from interface: MappingList
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.

Specified by:
isOnto in interface MappingList
Parameters:
imageGraph - The image graph.
Returns:
true if the map is onto.