Top Description Inners Fields Constructors Methods
org.eclipse.jgit.revplot

public Class PlotWalk

extends RevWalk
Class Inheritance
Static Imports
org.eclipse.jgit.lib.Constants.R_HEADS, .Constants.R_REMOTES, .Constants.R_TAGS

Specialized RevWalk for visualization of a commit graph.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private Map<AnyObjectId, Set<Ref>>
private Repository
private Map<AnyObjectId, Set<Ref>>

Constructor Summary

AccessConstructor and Description
public
PlotWalk(Repository
the repository the walker will obtain data from.
repo
)

Create a new revision walker for a given repository.

Method Summary

Modifier and TypeMethod and Description
public void
addAdditionalRefs(Iterable<Ref>
additional refs
refs
)

Add additional refs to the walk

protected RevCommit
createCommit(AnyObjectId
the object this walker requires a commit reference for.
id
)

Overrides org.eclipse.jgit.revwalk.RevWalk.createCommit.

Construct a new unparsed commit for the given object.

public void
dispose()

Overrides org.eclipse.jgit.revwalk.RevWalk.dispose.

Dispose all internal state and invalidate all RevObject instances.

private Ref[]
getRefs(AnyObjectId commitId)

public RevCommit
next()

Overrides org.eclipse.jgit.revwalk.RevWalk.next.

Pop the next most recent commit.

public void
sort(RevSort
a sorting strategy to enable or disable.
s
,
boolean
true if this strategy should be used, false if it should be removed.
use
)

Overrides org.eclipse.jgit.revwalk.RevWalk.sort.

Add or remove a sorting strategy for the returned commits.

Inherited from org.eclipse.jgit.revwalk.RevWalk:
assertNoCommitsMarkedStartassertNotStartedassumeShallowcarrycarryclosedisposeFlaggetMergedIntogetMergedIntogetObjectReadergetRevFiltergetRevSortgetTreeFilterhasRevSortisFirstParentisMergedIntoisMergedIntoAllisMergedIntoAnyisMergedIntoAnyCommitisRetainBodyiteratorlookupAnylookupBloblookupCommitlookupCommitlookupOrNulllookupTaglookupTreemarkStartmarkStartmarkUninterestingnewFlagparseAnyparseAnyparseBodyparseCommitparseHeadersparseTagparseTreepeelresetresetresetRetainresetRetainretainOnResetretainOnResetsetFirstParentsetRetainBodysetRevFiltersetRewriteParentssetTreeFiltersorttoObjectWalkWithSameObjects

Field Detail

additionalRefMapback to summary
private Map<AnyObjectId, Set<Ref>> additionalRefMap
repositoryback to summary
private Repository repository
reverseRefMapback to summary
private Map<AnyObjectId, Set<Ref>> reverseRefMap

Constructor Detail

PlotWalkback to summary
public PlotWalk(Repository repo)

Create a new revision walker for a given repository.

Parameters
repo:Repository

the repository the walker will obtain data from.

Method Detail

addAdditionalRefsback to summary
public void addAdditionalRefs(Iterable<Ref> refs) throws IOException

Add additional refs to the walk

Parameters
refs:Iterable<Ref>

additional refs

Exceptions
IOException:
if an IO error occurred
createCommitback to summary
protected RevCommit createCommit(AnyObjectId id)

Overrides org.eclipse.jgit.revwalk.RevWalk.createCommit.

Doc from org.eclipse.jgit.revwalk.RevWalk.createCommit.

Construct a new unparsed commit for the given object.

Parameters
id:AnyObjectId

the object this walker requires a commit reference for.

Returns:RevCommit

a new unparsed reference for the object.

Annotations
@Override
disposeback to summary
public void dispose()

Overrides org.eclipse.jgit.revwalk.RevWalk.dispose.

Doc from org.eclipse.jgit.revwalk.RevWalk.dispose.

Dispose all internal state and invalidate all RevObject instances.

All RevObject (and thus RevCommit, etc.) instances previously acquired from this RevWalk are invalidated by a dispose call. Applications must not retain or use RevObject instances obtained prior to the dispose call. All RevFlag instances are also invalidated, and must not be reused.

Annotations
@Override
getRefsback to summary
private Ref[] getRefs(AnyObjectId commitId) throws IOException
nextback to summary
public RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException

Overrides org.eclipse.jgit.revwalk.RevWalk.next.

Doc from org.eclipse.jgit.revwalk.RevWalk.next.

Pop the next most recent commit.

Returns:RevCommit

next most recent commit; null if traversal is over.

Annotations
@Override
Exceptions
MissingObjectException:
one or more of the next commit's parents are not available from the object database, but were thought to be candidates for traversal. This usually indicates a broken link.
IncorrectObjectTypeException:
one or more of the next commit's parents are not actually commit objects.
IOException:
a pack file or loose object could not be read.
sortback to summary
public void sort(RevSort s, boolean use)

Overrides org.eclipse.jgit.revwalk.RevWalk.sort.

Doc from org.eclipse.jgit.revwalk.RevWalk.sort.

Add or remove a sorting strategy for the returned commits.

Multiple strategies can be applied at once, in which case some strategies may take precedence over others. As an example, org.eclipse.jgit.revwalk.RevSort#TOPO must take precedence over org.eclipse.jgit.revwalk.RevSort#COMMIT_TIME_DESC, otherwise it cannot enforce its ordering.

Parameters
s:RevSort

a sorting strategy to enable or disable.

use:boolean

true if this strategy should be used, false if it should be removed.

Annotations
@Override
org.eclipse.jgit.revplot back to summary

pack-priv Class PlotWalk.PlotRefComparator

extends Object
implements Comparator<Ref>
Class Inheritance
All Implemented Interfaces
java.util.Comparator

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
compare(Ref
the first object to be compared.
o1
,
Ref
the second object to be compared.
o2
)

Implements java.util.Comparator.compare.

Compares its two arguments for order.

pack-priv int
kind(Ref r)

pack-priv long
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PlotRefComparatorback to summary
pack-priv PlotRefComparator()

Method Detail

compareback to summary
public int compare(Ref o1, Ref o2)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Parameters
o1:Ref

the first object to be compared.

o2:Ref

the second object to be compared.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Annotations
@Override
kindback to summary
pack-priv int kind(Ref r)
timeofback to summary
pack-priv long timeof(RevObject o)