Top Description Fields Constructors Methods
org.eclipse.jgit.internal.revwalk

public Class AddToBitmapWithCacheFilter

extends RevFilter
Class Inheritance
Imports
org.eclipse.jgit.lib.BitmapIndex.Bitmap, .BitmapIndex.BitmapBuilder, .Constants, .AnyObjectId, org.eclipse.jgit.revwalk.filter.RevFilter, org.eclipse.jgit.revwalk.RevWalk, .RevCommit, .RevFlag

A RevFilter that adds the visited commits to bitmap as a side effect.

When the walk hits a commit that is the same as cachedCommit or is part of bitmap's BitmapIndex, that entire bitmap is ORed into bitmap and the commit and its parents are marked as SEEN so that the walk does not have to visit its ancestors. This ensures the walk is very short if there is good bitmap coverage.

Field Summary

Modifier and TypeField and Description
private final BitmapIndex.BitmapBuilder
private final BitmapIndex.Bitmap
private final AnyObjectId
Inherited from org.eclipse.jgit.revwalk.filter.RevFilter:
ALLMERGE_BASENO_MERGESNONEONLY_MERGES

Constructor Summary

AccessConstructor and Description
public
AddToBitmapWithCacheFilter(AnyObjectId
the cached commit
cachedCommit
,
BitmapIndex.Bitmap
the bitmap corresponds to cachedCommit}
cachedBitmap
,
BitmapIndex.BitmapBuilder
bitmap to write visited commits to
bitmap
)

Create a filter with a cached BitmapCommit that adds visited commits to the given bitmap.

Method Summary

Modifier and TypeMethod and Description
public final RevFilter
clone()

Implements abstract org.eclipse.jgit.revwalk.filter.RevFilter.clone.

Creates and returns a copy of this object.

public final boolean
include(RevWalk
the active walker this filter is being invoked from within.
rw
,
RevCommit
the commit currently being tested. The commit has been parsed and its body is available for inspection only if the filter returns true from requiresCommitBody().
c
)

Implements abstract org.eclipse.jgit.revwalk.filter.RevFilter.include.

Determine if the supplied commit should be included in results.

public final boolean
requiresCommitBody()

Overrides org.eclipse.jgit.revwalk.filter.RevFilter.requiresCommitBody.

Whether the filter needs the commit body to be parsed.

Inherited from org.eclipse.jgit.revwalk.filter.RevFilter:
negatetoString

Field Detail

bitmapback to summary
private final BitmapIndex.BitmapBuilder bitmap
cachedBitmapback to summary
private final BitmapIndex.Bitmap cachedBitmap
cachedCommitback to summary
private final AnyObjectId cachedCommit

Constructor Detail

AddToBitmapWithCacheFilterback to summary
public AddToBitmapWithCacheFilter(AnyObjectId cachedCommit, BitmapIndex.Bitmap cachedBitmap, BitmapIndex.BitmapBuilder bitmap)

Create a filter with a cached BitmapCommit that adds visited commits to the given bitmap.

Parameters
cachedCommit:AnyObjectId

the cached commit

cachedBitmap:BitmapIndex.Bitmap

the bitmap corresponds to cachedCommit}

bitmap:BitmapIndex.BitmapBuilder

bitmap to write visited commits to

Method Detail

cloneback to summary
public final RevFilter clone()

Implements abstract org.eclipse.jgit.revwalk.filter.RevFilter.clone.

Doc from org.eclipse.jgit.revwalk.filter.RevFilter.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Clone this revision filter, including its parameters.

This is a deep clone. If this filter embeds objects or other filters it must also clone those, to ensure the instances do not share mutable data.

Returns:RevFilter

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
includeback to summary
public final boolean include(RevWalk rw, RevCommit c)

Implements abstract org.eclipse.jgit.revwalk.filter.RevFilter.include.

Doc from org.eclipse.jgit.revwalk.filter.RevFilter.include.

Determine if the supplied commit should be included in results.

Parameters
rw:RevWalk

the active walker this filter is being invoked from within.

c:RevCommit

the commit currently being tested. The commit has been parsed and its body is available for inspection only if the filter returns true from requiresCommitBody().

Returns:boolean

true to include this commit in the results; false to have this commit be omitted entirely from the results.

Annotations
@Override
requiresCommitBodyback to summary
public final boolean requiresCommitBody()

Overrides org.eclipse.jgit.revwalk.filter.RevFilter.requiresCommitBody.

Doc from org.eclipse.jgit.revwalk.filter.RevFilter.requiresCommitBody.

Whether the filter needs the commit body to be parsed.

Returns:boolean

true if the filter needs the commit body to be parsed.

Annotations
@Override