public class ReferencePath extends Object
This class behaves in a way that is very similar to a List as a ReferencePath is essentially an ordered sequence of Reference's. For that reason methods in common with List are named the same.
Note that a ReferencePath is NOT a List. If it extended a List class it would carry over methods that are not appropriate for a ReferencePath.
| Constructor and Description |
|---|
ReferencePath()
Default constructor;
|
ReferencePath(ReferencePath referencePath)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Reference reference)
Adds a
Reference to the end of the ReferencePath. |
void |
add(ReferencePath referencePath)
Adds a ReferencePath to the end of this ReferencePath.
|
int |
findModuleVersion(ModuleVersion moduleVersion)
Finds a
ModuleVersion. |
Reference |
get(int index)
Returns a
Reference in the ReferencePath given an index. |
ModuleVersion |
getLeafModuleVersion() |
Reference |
getLeafReference() |
void |
removeLeafReference()
Removes the leaf
Reference (from the tail of the List). |
void |
removeLeafReferences(int nbReferences)
Removes a given number of leaf
Reference (from the tail of the List). |
void |
removeRootReference()
Removes the root
Reference (from the head of the List). |
void |
removeRootReferences(int nbReferences)
Removes a given number of root
Reference's (from the head of the List). |
int |
size() |
String |
toString()
ReferencePath's are often displayed to the user and need to be shown in a
human-friendly and not too cryptic way.
|
public ReferencePath()
public ReferencePath(ReferencePath referencePath)
referencePath - ReferencePath.public void add(Reference reference)
Reference to the end of the ReferencePath.
The new Reference must not create a cycle among the Module's.
reference - Reference.public void add(ReferencePath referencePath)
The new Reference must not create a cycle among the Module's.
referencePath - ReferencePath.public int size()
Reference's in the ReferencePath.public Reference get(int index)
Reference in the ReferencePath given an index.index - Index.public void removeRootReference()
Reference (from the head of the List).public void removeRootReferences(int nbReferences)
Reference's (from the head of the List).nbReferences - Number of references.public Reference getLeafReference()
Reference (from the tail of the List).public ModuleVersion getLeafModuleVersion()
ModuleVersion (from the tail of the List).public void removeLeafReference()
Reference (from the tail of the List).public void removeLeafReferences(int nbReferences)
Reference (from the tail of the List).nbReferences - Number of references.public int findModuleVersion(ModuleVersion moduleVersion)
ModuleVersion.public String toString()
The Reference's within a ReferencePath are not totally distinct
elements. A Reference includes a ModuleVersion, but also implementation
data that relates to how it is expressed in some parent ModuleVersion. When
such implementation data is available, the Reference is separated from its
parent using "->". Otherwise, "|>" is used to denote discontinuity. This
happens when Reference's are recreated during the traversal of reference
graphs in some jobs.
Copyright © 2015–2017 AZYVA INC.. All rights reserved.