public class MetadataGraph
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_EDGES |
static int |
DEFAULT_VERTICES |
(package private) MetadataGraphVertex |
entry
the entry point we started building the graph from
|
(package private) java.util.Map<MetadataGraphVertex,java.util.List<MetadataGraphEdge>> |
excidentEdges |
(package private) java.util.Map<MetadataGraphVertex,java.util.List<MetadataGraphEdge>> |
incidentEdges
incident and excident edges per node
|
(package private) ArtifactScopeEnum |
scope
null in dirty graph, actual
scope for conflict-resolved graph
|
private boolean |
scopedVertices |
private boolean |
versionedVertices |
(package private) java.util.TreeSet<MetadataGraphVertex> |
vertices |
Constructor and Description |
---|
MetadataGraph(int nVertices)
init graph
|
MetadataGraph(int nVertices,
int nEdges) |
MetadataGraph(MetadataGraphVertex entry)
construct a single vertex
|
MetadataGraph(MetadataTreeNode tree)
construct graph from a "dirty" tree
|
MetadataGraph(MetadataTreeNode tree,
boolean versionedVertices,
boolean scopedVertices)
construct graph from a "dirty" tree
|
public static final int DEFAULT_VERTICES
public static final int DEFAULT_EDGES
private boolean versionedVertices
private boolean scopedVertices
MetadataGraphVertex entry
java.util.TreeSet<MetadataGraphVertex> vertices
java.util.Map<MetadataGraphVertex,java.util.List<MetadataGraphEdge>> incidentEdges
java.util.Map<MetadataGraphVertex,java.util.List<MetadataGraphEdge>> excidentEdges
ArtifactScopeEnum scope
public MetadataGraph(int nVertices)
public MetadataGraph(int nVertices, int nEdges)
public MetadataGraph(MetadataGraphVertex entry) throws MetadataResolutionException
MetadataResolutionException
public MetadataGraph(MetadataTreeNode tree) throws MetadataResolutionException
MetadataResolutionException
public MetadataGraph(MetadataTreeNode tree, boolean versionedVertices, boolean scopedVertices) throws MetadataResolutionException
tree
- "dirty" tree rootversionedVertices
- true if graph nodes should be versioned (different versions -> different nodes)scopedVertices
- true if graph nodes should be versioned and scoped
(different versions and/or scopes -> different nodes)MetadataResolutionException
private void processTreeNodes(MetadataGraphVertex parentVertex, MetadataTreeNode node, int depth, int pomOrder) throws MetadataResolutionException
MetadataResolutionException
public MetadataGraphVertex findVertex(ArtifactMetadata md)
public MetadataGraphVertex addVertex(ArtifactMetadata md)
private void init(int nVertices, int nEdges)
private void checkVertices()
private void checkVertices(int nVertices)
private void checkEdges()
private void checkEdges(int nEdges)
private static void checkVertex(MetadataGraphVertex v) throws MetadataResolutionException
MetadataResolutionException
private static void checkEdge(MetadataGraphEdge e) throws MetadataResolutionException
MetadataResolutionException
public java.util.List<MetadataGraphEdge> getEdgesBetween(MetadataGraphVertex vFrom, MetadataGraphVertex vTo)
public MetadataGraph addEdge(MetadataGraphVertex vFrom, MetadataGraphVertex vTo, MetadataGraphEdge e) throws MetadataResolutionException
MetadataResolutionException
public MetadataGraph removeVertex(MetadataGraphVertex v)
private static int countNodes(MetadataTreeNode tree)
public MetadataGraphVertex getEntry()
public void setEntry(MetadataGraphVertex entry)
public java.util.TreeSet<MetadataGraphVertex> getVertices()
public java.util.List<MetadataGraphEdge> getIncidentEdges(MetadataGraphVertex vertex)
public java.util.List<MetadataGraphEdge> getExcidentEdges(MetadataGraphVertex vertex)
public boolean isVersionedVertices()
public void setVersionedVertices(boolean versionedVertices)
public boolean isScopedVertices()
public void setScopedVertices(boolean scopedVertices)
public ArtifactScopeEnum getScope()
public void setScope(ArtifactScopeEnum scope)
public boolean isEmpty()
public boolean isEmptyEdges()
public java.lang.String toString()
toString
in class java.lang.Object