Class DependencyReference
-
- All Implemented Interfaces:
-
kotlin.Comparable
public final class DependencyReference implements Comparable<DependencyReference>
A class to model a tree-like structure to represent the dependencies of a project.
Instances of this class are used to store the relations between dependencies in fragments of dependency trees in an Analyzer result. The main purpose of this class is to define an efficient serialization format, which avoids redundancy as far as possible. Therefore, dependencies are represented by numeric indices into an external table. As a dependency can occur multiple times in the dependency graph with different transitive dependencies, the class defines another index to distinguish these cases.
Note: This is by intention no data class. Equality is tested via references and not via the values contained.
-
-
Field Summary
Fields Modifier and Type Field Description private final Integerpkgprivate final Integerfragmentprivate final SortedSet<DependencyReference>dependenciesprivate final PackageLinkagelinkageprivate final List<Issue>issues
-
Constructor Summary
Constructors Constructor Description DependencyReference(Integer pkg, Integer fragment, SortedSet<DependencyReference> dependencies, PackageLinkage linkage, List<Issue> issues)
-
Method Summary
Modifier and Type Method Description final IntegergetPkg()Stores the numeric index of the package dependency referenced by this object. final IntegergetFragment()Stores the index of the fragment in the dependency graph where the referenced dependency is contained. final SortedSet<DependencyReference>getDependencies()A set with the references to the dependencies of this dependency. final PackageLinkagegetLinkage()The type of linkage used for the referred package from its dependent package. final List<Issue>getIssues()A list of Issues that occurred handling this dependency. IntegercompareTo(DependencyReference other)Define an order on DependencyReference instances. -
-
Constructor Detail
-
DependencyReference
DependencyReference(Integer pkg, Integer fragment, SortedSet<DependencyReference> dependencies, PackageLinkage linkage, List<Issue> issues)
-
-
Method Detail
-
getPkg
final Integer getPkg()
Stores the numeric index of the package dependency referenced by this object. The package behind this index can be resolved by evaluating the list of identifiers stored in DependencyGraph at this index.
-
getFragment
final Integer getFragment()
Stores the index of the fragment in the dependency graph where the referenced dependency is contained. This is needed to uniquely identify the target if the dependency occurs multiple times in the graph.
-
getDependencies
final SortedSet<DependencyReference> getDependencies()
A set with the references to the dependencies of this dependency. That way a tree-like structure is established.
-
getLinkage
final PackageLinkage getLinkage()
The type of linkage used for the referred package from its dependent package. As most of our supported package managers / languages only support dynamic linking or at least default to it, also use that as the default value here to not blow up our result files.
-
compareTo
Integer compareTo(DependencyReference other)
Define an order on DependencyReference instances. Instances are ordered by their indices and fragment indices.
-
-
-
-