org.gitective.core.filter.commit
Class CommitDiffEditFilter

java.lang.Object
  extended by org.eclipse.jgit.revwalk.filter.RevFilter
      extended by org.gitective.core.filter.commit.CommitFilter
          extended by org.gitective.core.filter.commit.CommitDiffFilter
              extended by org.gitective.core.filter.commit.CommitDiffEditFilter
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
CommitLineImpactFilter, CompositeDiffEditFilter, DiffCountFilter, DiffLineCountFilter, DiffLineSizeFilter

public class CommitDiffEditFilter
extends CommitDiffFilter

Commit diff filter that computes the line edits introduced by each commit visited and calls include(RevCommit, DiffEntry, Collection) with all the edits and include(RevCommit, DiffEntry, Edit) for each individual edit.


Field Summary
 
Fields inherited from class org.gitective.core.filter.commit.CommitDiffFilter
detectRenames, renameDetector
 
Fields inherited from class org.gitective.core.filter.commit.CommitFilter
repository
 
Fields inherited from class org.eclipse.jgit.revwalk.filter.RevFilter
ALL, MERGE_BASE, NO_MERGES, NONE
 
Constructor Summary
CommitDiffEditFilter()
          Create commit diff edit filter
CommitDiffEditFilter(boolean detectRenames)
          Create commit diff edit filter
 
Method Summary
protected  boolean include(org.eclipse.jgit.revwalk.RevCommit commit, org.eclipse.jgit.diff.DiffEntry diff, Collection<org.eclipse.jgit.diff.Edit> edits)
          Handle the edits introduced by given commit.
protected  boolean include(org.eclipse.jgit.revwalk.RevCommit commit, org.eclipse.jgit.diff.DiffEntry diff, org.eclipse.jgit.diff.Edit edit)
          Handle the edit introduced by given commit.
 boolean include(org.eclipse.jgit.revwalk.RevWalk walker, org.eclipse.jgit.revwalk.RevCommit commit, Collection<org.eclipse.jgit.diff.DiffEntry> diffs)
          Handle the differences introduced by given commit.
protected  CommitDiffEditFilter markEnd(org.eclipse.jgit.revwalk.RevCommit commit)
          Mark the end of a commit being processed
protected  CommitDiffEditFilter markStart(org.eclipse.jgit.revwalk.RevCommit commit)
          Mark the start of a commit being processed
 
Methods inherited from class org.gitective.core.filter.commit.CommitDiffFilter
createTreeWalk, include, include, isFileDiff, setRepository
 
Methods inherited from class org.gitective.core.filter.commit.CommitFilter
clone, include, reset, setStop
 
Methods inherited from class org.eclipse.jgit.revwalk.filter.RevFilter
negate, requiresCommitBody, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommitDiffEditFilter

public CommitDiffEditFilter()
Create commit diff edit filter


CommitDiffEditFilter

public CommitDiffEditFilter(boolean detectRenames)
Create commit diff edit filter

Parameters:
detectRenames -
Method Detail

markStart

protected CommitDiffEditFilter markStart(org.eclipse.jgit.revwalk.RevCommit commit)
Mark the start of a commit being processed

Sub-classes should override this method instead of overriding CommitDiffFilter.include(org.eclipse.jgit.revwalk.RevWalk, RevCommit) and calling super.

Parameters:
commit -
Returns:
this filter

markEnd

protected CommitDiffEditFilter markEnd(org.eclipse.jgit.revwalk.RevCommit commit)
Mark the end of a commit being processed

Sub-classes should override this method instead of overriding CommitDiffFilter.include(org.eclipse.jgit.revwalk.RevWalk, RevCommit) and calling super.

Parameters:
commit -
Returns:
this filter

include

public boolean include(org.eclipse.jgit.revwalk.RevWalk walker,
                       org.eclipse.jgit.revwalk.RevCommit commit,
                       Collection<org.eclipse.jgit.diff.DiffEntry> diffs)
Description copied from class: CommitDiffFilter
Handle the differences introduced by given commit.

Sub-classes should override this method. The default implementation calls CommitDiffFilter.include(RevCommit, Collection).

Overrides:
include in class CommitDiffFilter
Parameters:
walker - non-null
commit - non-null
diffs - non-null
Returns:
true to continue, false to abort

include

protected boolean include(org.eclipse.jgit.revwalk.RevCommit commit,
                          org.eclipse.jgit.diff.DiffEntry diff,
                          Collection<org.eclipse.jgit.diff.Edit> edits)
Handle the edits introduced by given commit.

Sub-classes should override this method. The default implementation call include(RevCommit, DiffEntry, Edit) for each edit.

Parameters:
commit - non-null
diff - non-null
edits - non-null
Returns:
true to continue, false to abort

include

protected boolean include(org.eclipse.jgit.revwalk.RevCommit commit,
                          org.eclipse.jgit.diff.DiffEntry diff,
                          org.eclipse.jgit.diff.Edit edit)
Handle the edit introduced by given commit.

Sub-classes should override this method. The default implementation returns true in all cases.

Parameters:
commit - non-null
diff - non-null
edit - non-null
Returns:
true to continue, false to abort


Copyright © 2011-2012. All Rights Reserved.