public interface ReferenceGraph
ModuleVersion's and operations that can
can be performed on it.
The concept of matched ModuleVersion is supported. A ReferenceGraph is generally
built by traversing the ModuleVersion's and their references using a
ReferencePathMatcher in which case it is possible to mark those
ModuleVersion's that are specifically matched by the ReferencePathMatcher. Note
that a ReferencePathMatcher matches a complete ReferencePath. But in a
ReferenceGraph the ModuleVersion's themselves are marked as matched. This means
that in a ReferenceGraph it is not possible to know which ReferencePath leading
to a given ModuleVersion was actually matched. For now it is assumed that once
the ReferenceGraph is built, that information is not really useful anymore.
Currently this is not very widely used within Dragom. It is used to gather and expose ReferenceGraph data in order to make it easier to implement reporting tools.
Currently, ReferencePath's are used extensively, but the reference
graphs to which they relate are implicit during the traversal of the
Reference's between Module's.
It is possible that eventually the concept of ReferenceGraph becomes more important. Specifically it is conceivable that ReferenceGraph data be cached in some persistent storage in order to improve performance of some operations that otherwise require the repeated loading and interpretation of Module build scripts to extract the Reference's.
| Modifier and Type | Interface and Description |
|---|---|
static class |
ReferenceGraph.ReentryMode
Reentry mode to determine what to do when a
ModuleVersion has already
been visisted during the traversal of a ReferenceGraph. |
static class |
ReferenceGraph.Referrer
Represents a
ModuleVersion that references another ModuleVersion. |
static class |
ReferenceGraph.VisitAction
Action during the traversal of a
ReferenceGraph. |
static class |
ReferenceGraph.VisitControl
Controls the subsequent visit actions during a traversal of the
ReferenceGraph.
|
static interface |
ReferenceGraph.Visitor
Visitor interface.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMatchedReferencePath(ReferencePath referencePath)
Adds a complete
ReferencePath to the ReferenceGraph and makes the leaf
ModuleVersion matched. |
void |
addReference(ModuleVersion moduleVersionReferrer,
Reference reference)
Adds a
Reference to the ReferenceGraph. |
void |
addRootModuleVersion(ModuleVersion moduleVersionRoot)
Adds a root
ModuleVersion. |
List<ModuleVersion> |
getListModuleVersion(NodePath nodePath)
|
List<ModuleVersion> |
getListModuleVersionMatched() |
List<ModuleVersion> |
getListModuleVersionRoot() |
List<Reference> |
getListReference(ModuleVersion moduleVersionReferrer)
Returns the List of
Reference's of a specified ModuleVersion. |
List<ReferenceGraph.Referrer> |
getListReferrer(ModuleVersion moduleVersionReferred)
Returns the List of
ReferenceGraph.Referrer's to a specified ModuleVersion. |
boolean |
isMatchedModuleVersion(ModuleVersion moduleVersion)
Indicates if a
ModuleVersion is matched. |
boolean |
isRootModuleVersion(ModuleVersion moduleVersion)
Indicates if a
ModuleVersion is a root of the ReferenceGraph. |
boolean |
moduleVersionExists(ModuleVersion moduleVersion)
Indicates if a
ModuleVersion is part of the ReferenceGraph. |
boolean |
traverseReferenceGraph(ModuleVersion moduleVersion,
boolean indDepthFirst,
ReferenceGraph.ReentryMode reentryMode,
ReferenceGraph.Visitor visitor)
Traverses the ReferenceGraph starting at a given
ModuleVersion or for
each root ModuleVersion. |
boolean |
visitLeafModuleVersionReferencePaths(ModuleVersion moduleVersion,
ReferenceGraph.Visitor visitor)
Visits all
ReferencePath's ending with a leaf ModuleVersion. |
boolean moduleVersionExists(ModuleVersion moduleVersion)
ModuleVersion is part of the ReferenceGraph.moduleVersion - ModuleVersion.List<ModuleVersion> getListModuleVersionRoot()
ModuleVersion that are the roots of the ReferenceGraph.boolean isRootModuleVersion(ModuleVersion moduleVersion)
ModuleVersion is a root of the ReferenceGraph.moduleVersion - ModuleVersion.List<ModuleVersion> getListModuleVersionMatched()
ModuleVersion that are matched.boolean isMatchedModuleVersion(ModuleVersion moduleVersion)
ModuleVersion is matched.moduleVersion - ModuleVersion.List<ModuleVersion> getListModuleVersion(NodePath nodePath)
nodePath - NodePath. Can be null in which case all ModuleVersions's in the
ReferenceGraph are returned.List<ReferenceGraph.Referrer> getListReferrer(ModuleVersion moduleVersionReferred)
ReferenceGraph.Referrer's to a specified ModuleVersion.moduleVersionReferred - Referred ModuleVersion.List<Reference> getListReference(ModuleVersion moduleVersionReferrer)
Reference's of a specified ModuleVersion.moduleVersionReferrer - Referrer ModuleVersion.boolean traverseReferenceGraph(ModuleVersion moduleVersion, boolean indDepthFirst, ReferenceGraph.ReentryMode reentryMode, ReferenceGraph.Visitor visitor)
ModuleVersion or for
each root ModuleVersion.moduleVersion - ModuleVersion at which to start the traversal. Can be null
to indicate to perform the traversal for each root ModuleVersion.indDepthFirst - Indicates that the traversal is depth-first, as opposed to
parent-first.reentryMode - ReentryMode.visitor - Visitor.ReferenceGraph.Visitor.visit(org.azyva.dragom.reference.ReferenceGraph, org.azyva.dragom.reference.ReferencePath, java.util.EnumSet<org.azyva.dragom.reference.ReferenceGraph.VisitAction>)
returned ReferenceGraph.VisitControl.ABORT).boolean visitLeafModuleVersionReferencePaths(ModuleVersion moduleVersion, ReferenceGraph.Visitor visitor)
ReferencePath's ending with a leaf ModuleVersion.moduleVersion - Leaf ModuleVersion.visitor - Visitor.ReferenceGraph.Visitor.visit(org.azyva.dragom.reference.ReferenceGraph, org.azyva.dragom.reference.ReferencePath, java.util.EnumSet<org.azyva.dragom.reference.ReferenceGraph.VisitAction>)
returned ReferenceGraph.VisitControl.ABORT).void addRootModuleVersion(ModuleVersion moduleVersionRoot)
ModuleVersion.
If the ModuleVersion already exists, it is made a root (if not already).
moduleVersionRoot - Root ModuleVersion.void addReference(ModuleVersion moduleVersionReferrer, Reference reference)
Reference to the ReferenceGraph.
The referrer ModuleVersion must already exist in the ReferenceGraph. It may be a root.
The referred-to ModuleVersion within the Reference is created if it does not exist.
The Reference may already exist in which case it is not added.
The newly added Reference must not create a cycle in the ReferenceGraph.
moduleVersionReferrer - Referrer ModuleVersion.reference - Reference.void addMatchedReferencePath(ReferencePath referencePath)
ReferencePath to the ReferenceGraph and makes the leaf
ModuleVersion matched.
Reference's that already exist are not added. But the leaf
ModuleVersion is made matched (if not already).
The newly added Reference's must not create cycles in the ReferenceGraph.
referencePath - ReferencePath.Copyright © 2015–2017 AZYVA INC.. All rights reserved.