Class MetadataGraph
- java.lang.Object
-
- org.apache.maven.repository.metadata.MetadataGraph
-
public class MetadataGraph extends java.lang.Object
maven dependency metadata graph
-
-
Field Summary
Fields Modifier and Type Field 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 graphprivate boolean
scopedVertices
private boolean
versionedVertices
(package private) java.util.TreeSet<MetadataGraphVertex>
vertices
-
Constructor Summary
Constructors Constructor Description MetadataGraph(int nVertices)
init graphMetadataGraph(int nVertices, int nEdges)
MetadataGraph(MetadataGraphVertex entry)
construct a single vertexMetadataGraph(MetadataTreeNode tree)
construct graph from a "dirty" treeMetadataGraph(MetadataTreeNode tree, boolean versionedVertices, boolean scopedVertices)
construct graph from a "dirty" tree
-
Method Summary
-
-
-
Field Detail
-
DEFAULT_VERTICES
public static final int DEFAULT_VERTICES
- See Also:
- Constant Field Values
-
DEFAULT_EDGES
public static final int DEFAULT_EDGES
- See Also:
- Constant Field Values
-
versionedVertices
private boolean versionedVertices
-
scopedVertices
private boolean scopedVertices
-
entry
MetadataGraphVertex entry
the entry point we started building the graph from
-
vertices
java.util.TreeSet<MetadataGraphVertex> vertices
-
incidentEdges
java.util.Map<MetadataGraphVertex,java.util.List<MetadataGraphEdge>> incidentEdges
incident and excident edges per node
-
excidentEdges
java.util.Map<MetadataGraphVertex,java.util.List<MetadataGraphEdge>> excidentEdges
-
scope
ArtifactScopeEnum scope
null in dirty graph, actual scope for conflict-resolved graph
-
-
Constructor Detail
-
MetadataGraph
public MetadataGraph(int nVertices)
init graph
-
MetadataGraph
public MetadataGraph(int nVertices, int nEdges)
-
MetadataGraph
public MetadataGraph(MetadataGraphVertex entry) throws MetadataResolutionException
construct a single vertex- Throws:
MetadataResolutionException
-
MetadataGraph
public MetadataGraph(MetadataTreeNode tree) throws MetadataResolutionException
construct graph from a "dirty" tree- Throws:
MetadataResolutionException
-
MetadataGraph
public MetadataGraph(MetadataTreeNode tree, boolean versionedVertices, boolean scopedVertices) throws MetadataResolutionException
construct graph from a "dirty" tree- Parameters:
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)- Throws:
MetadataResolutionException
-
-
Method Detail
-
processTreeNodes
private void processTreeNodes(MetadataGraphVertex parentVertex, MetadataTreeNode node, int depth, int pomOrder) throws MetadataResolutionException
- Throws:
MetadataResolutionException
-
findVertex
public MetadataGraphVertex findVertex(ArtifactMetadata md)
-
addVertex
public MetadataGraphVertex addVertex(ArtifactMetadata md)
-
init
private void init(int nVertices, int nEdges)
init graph
-
checkVertices
private void checkVertices()
-
checkVertices
private void checkVertices(int nVertices)
-
checkEdges
private void checkEdges()
-
checkEdges
private void checkEdges(int nEdges)
-
checkVertex
private static void checkVertex(MetadataGraphVertex v) throws MetadataResolutionException
- Throws:
MetadataResolutionException
-
checkEdge
private static void checkEdge(MetadataGraphEdge e) throws MetadataResolutionException
- Throws:
MetadataResolutionException
-
getEdgesBetween
public java.util.List<MetadataGraphEdge> getEdgesBetween(MetadataGraphVertex vFrom, MetadataGraphVertex vTo)
-
addEdge
public MetadataGraph addEdge(MetadataGraphVertex vFrom, MetadataGraphVertex vTo, MetadataGraphEdge e) throws MetadataResolutionException
- Throws:
MetadataResolutionException
-
removeVertex
public MetadataGraph removeVertex(MetadataGraphVertex v)
-
countNodes
private static int countNodes(MetadataTreeNode tree)
-
getEntry
public MetadataGraphVertex getEntry()
-
setEntry
public void setEntry(MetadataGraphVertex entry)
-
getVertices
public java.util.TreeSet<MetadataGraphVertex> getVertices()
-
getIncidentEdges
public java.util.List<MetadataGraphEdge> getIncidentEdges(MetadataGraphVertex vertex)
-
getExcidentEdges
public java.util.List<MetadataGraphEdge> getExcidentEdges(MetadataGraphVertex vertex)
-
isVersionedVertices
public boolean isVersionedVertices()
-
setVersionedVertices
public void setVersionedVertices(boolean versionedVertices)
-
isScopedVertices
public boolean isScopedVertices()
-
setScopedVertices
public void setScopedVertices(boolean scopedVertices)
-
getScope
public ArtifactScopeEnum getScope()
-
setScope
public void setScope(ArtifactScopeEnum scope)
-
isEmpty
public boolean isEmpty()
-
isEmptyEdges
public boolean isEmptyEdges()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-