Package org.goplanit.graph
Class GraphImpl<V extends Vertex,E extends Edge>
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.graph.UntypedGraphImpl<V,E>
-
- org.goplanit.graph.GraphImpl<V,E>
-
- All Implemented Interfaces:
Comparable<IdAble>
,Graph<V,E>
,UntypedGraph<V,E>
,IdAble
,ManagedId
public class GraphImpl<V extends Vertex,E extends Edge> extends UntypedGraphImpl<V,E> implements Graph<V,E>
A graph implementation consisting of vertices and edges- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.graph.UntypedGraphImpl
edges, vertices
-
Fields inherited from interface org.goplanit.utils.graph.UntypedGraph
GRAPH_ID_CLASS
-
-
Constructor Summary
Constructors Constructor Description GraphImpl(GraphImpl<V,E> graphImpl, boolean deepCopy, GraphEntityDeepCopyMapper<V> vertexMapper, GraphEntityDeepCopyMapper<E> edgeMapper)
Copy constructor for shallow copyGraphImpl(IdGroupingToken groupId, GraphEntities<V> vertices, GraphEntities<E> edges)
Graph Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GraphImpl<V,E>
deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call.GraphImpl<V,E>
shallowClone()
Create a shallow copy of this entity-
Methods inherited from class org.goplanit.graph.UntypedGraphImpl
generatedGraphId, getEdges, getGraphIdGroupingToken, getIdClass, getVertices, recreateManagedIds, smartDeepClone
-
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, generateId, getId, hashCode, setId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
getIdClass, recreateManagedIds, resetChildManagedIdEntities
-
Methods inherited from interface org.goplanit.utils.graph.UntypedGraph
getEdges, getVertices, isEmpty, transformGeometries, validate
-
-
-
-
Constructor Detail
-
GraphImpl
public GraphImpl(IdGroupingToken groupId, GraphEntities<V> vertices, GraphEntities<E> edges)
Graph Constructor- Parameters:
groupId
- contiguous id generation within this group for instances of this classvertices
- to useedges
- to use
-
GraphImpl
public GraphImpl(GraphImpl<V,E> graphImpl, boolean deepCopy, GraphEntityDeepCopyMapper<V> vertexMapper, GraphEntityDeepCopyMapper<E> edgeMapper)
Copy constructor for shallow copy- Parameters:
graphImpl
- to copyvertexMapper
- mapper to track mappingedgeMapper
- mapper to tracking mappingdeepCopy
- when true, create a deep copy, shallow copy otherwise
-
-
Method Detail
-
shallowClone
public GraphImpl<V,E> shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in interfaceUntypedGraph<V extends Vertex,E extends Edge>
- Overrides:
shallowClone
in classUntypedGraphImpl<V extends Vertex,E extends Edge>
- Returns:
- shallow copy of entity
-
deepClone
public GraphImpl<V,E> deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code for Graphs we also update the interdependencies between its internal containers when performing a deep copy
-
-