|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractSet<E> java.util.HashSet<E> java.util.LinkedHashSet<EObject> org.eclipse.emf.henshin.interpreter.impl.EGraphImpl org.eclipse.emf.henshin.interpreter.impl.PartitionedEGraphImpl
public class PartitionedEGraphImpl
Default implementation of PartitionedEGraph
.
Field Summary |
---|
Fields inherited from class org.eclipse.emf.henshin.interpreter.impl.EGraphImpl |
---|
crossReferenceAdapter, domainMap, inheritanceMap, packages |
Constructor Summary | |
---|---|
PartitionedEGraphImpl(Collection<? extends EObject> collection,
int numPartitions)
Convenience constructor. |
|
PartitionedEGraphImpl(EObject object,
int partitionCount)
Convenience constructor. |
|
PartitionedEGraphImpl(int numPartitions)
Default constructor. |
|
PartitionedEGraphImpl(Resource resource,
int numPartitions)
Convenience constructor. |
Method Summary | |
---|---|
protected void |
addChildParentRelation(EClass child,
EClass parent)
Update the inheritance map. |
void |
clear()
|
protected void |
didAdd(EObject object)
Notify that an object has been added to the graph. |
protected void |
didRemove(EObject object)
Notify that an object has been removed from the graph. |
List<EObject> |
getDomain(EClass type,
boolean strict)
Get all EObject s of this graph which are compatible with the given type. |
List<EObject> |
getDomain(EClass type,
boolean strict,
int partition)
Get all EObject s of this graph which are compatible with the given type
and are in a given partition. |
protected Collection<EObject> |
getDomain(EClass type,
int partition)
Get the domain for a given type and partition. |
int |
getDomainSize(EClass type,
boolean strict)
Returns the size of the domain for a type. |
int |
getDomainSize(EClass type,
boolean strict,
int partition)
Returns the size of the domain for a type in a partition. |
protected int |
getNextPartition(EClass type)
Get the next partition to use for adding a new object. |
int |
getNumPartitions()
Get the number of partitions of this partitioned graph. |
protected List<EClass> |
getPartitionTypes(EClass type)
Get the list of proxy partition types for a (real) type. |
protected void |
initializePartitions(int numPartitions)
Initialize the partitioned graph. |
Methods inherited from class org.eclipse.emf.henshin.interpreter.impl.EGraphImpl |
---|
add, addAll, addEPackage, addGraph, addTree, copy, getCrossReferenceAdapter, getDomain, getRoots, initializeContents, remove, removeAll, removeGraph, removeTree, toString |
Methods inherited from class java.util.HashSet |
---|
clone, contains, isEmpty, iterator, size |
Methods inherited from class java.util.AbstractSet |
---|
equals, hashCode |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.emf.henshin.interpreter.EGraph |
---|
addGraph, addTree, copy, getCrossReferenceAdapter, getRoots, removeGraph, removeTree |
Methods inherited from interface java.util.Collection |
---|
add, addAll, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Methods inherited from interface java.util.Set |
---|
contains, containsAll, equals, hashCode, isEmpty, iterator, retainAll, size, toArray, toArray |
Constructor Detail |
---|
public PartitionedEGraphImpl(int numPartitions)
numPartitions
- Number of partitions to use.public PartitionedEGraphImpl(EObject object, int partitionCount)
object
- An object.partitionCount
- Number of partitions to use.public PartitionedEGraphImpl(Collection<? extends EObject> collection, int numPartitions)
collection
- A collection of objects.numPartitions
- Number of partitions to use.public PartitionedEGraphImpl(Resource resource, int numPartitions)
resource
- A resource.numPartitions
- Number of partitions to use.Method Detail |
---|
protected void initializePartitions(int numPartitions)
numPartitions
- Number of partitions.protected void didAdd(EObject object)
EGraphImpl
didAdd
in class EGraphImpl
object
- Added object.protected void didRemove(EObject object)
EGraphImpl
didRemove
in class EGraphImpl
object
- Removed object.protected int getNextPartition(EClass type)
type
- The (real) type of the object.
protected void addChildParentRelation(EClass child, EClass parent)
EGraphImpl
addChildParentRelation
in class EGraphImpl
child
- Child class.parent
- Parent class.public int getNumPartitions()
PartitionedEGraph
getNumPartitions
in interface PartitionedEGraph
public void clear()
clear
in interface Collection<EObject>
clear
in interface Set<EObject>
clear
in class EGraphImpl
public List<EObject> getDomain(EClass type, boolean strict)
EGraph
EObject
s of this graph which are compatible with the given type.
This returns a fresh and modifiable list.
getDomain
in interface EGraph
getDomain
in class EGraphImpl
type
- The type of the objects.strict
- Whether subtypes are excluded from the result.
EObject
s compatible with the type.public int getDomainSize(EClass type, boolean strict)
EGraph
EGraph.getDomain(EClass, boolean)
.
This method should be used whenever the actual objects are not needed.
getDomainSize
in interface EGraph
getDomainSize
in class EGraphImpl
type
- The type.strict
- Whether subtypes are excluded.
public List<EObject> getDomain(EClass type, boolean strict, int partition)
PartitionedEGraph
EObject
s of this graph which are compatible with the given type
and are in a given partition. The partition must be greater or equal zero and
strictly less than the number of partitions of this graph.
This returns a fresh and modifiable list.
getDomain
in interface PartitionedEGraph
type
- The type of the objects.strict
- Whether subtypes are excluded from the result.partition
- The partition to be used.
EObject
s compatible with the type.public int getDomainSize(EClass type, boolean strict, int partition)
PartitionedEGraph
PartitionedEGraph.getDomain(EClass, boolean, int)
.
This method should be used whenever the actual objects are not needed.
getDomainSize
in interface PartitionedEGraph
type
- The type.strict
- Whether subtypes are excluded.partition
- The partition to be used.
protected List<EClass> getPartitionTypes(EClass type)
type
- The actual object type.
protected Collection<EObject> getDomain(EClass type, int partition)
type
- An object type.partition
- A partition index.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |