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

public Class AddUnseenToBitmapFilter

extends RevFilter
Class Inheritance
Imports
org.eclipse.jgit.lib.BitmapIndex.Bitmap, .BitmapIndex.BitmapBuilder, .Constants, 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 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.

Commits named in seen are considered already seen. If one is encountered, that commit and its parents will be marked with the SEEN flag to prevent the walk from visiting its ancestors.

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
AddUnseenToBitmapFilter(BitmapIndex.BitmapBuilder
objects that are already seen
seen
,
BitmapIndex.BitmapBuilder
bitmap to write visited commits to
bitmap
)

Create a filter that adds visited commits to the given bitmap, but does not walk through the objects in seen.

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.
walker
,
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().
cmit
)

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
seenback to summary
private final BitmapIndex.BitmapBuilder seen

Constructor Detail

AddUnseenToBitmapFilterback to summary
public AddUnseenToBitmapFilter(BitmapIndex.BitmapBuilder seen, BitmapIndex.BitmapBuilder bitmap)

Create a filter that adds visited commits to the given bitmap, but does not walk through the objects in seen.

Parameters
seen:BitmapIndex.BitmapBuilder

objects that are already seen

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 walker, RevCommit cmit)

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
walker:RevWalk

the active walker this filter is being invoked from within.

cmit: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