org.gitective.core.filter.commit
Class CommitLineImpactFilter

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
                  extended by org.gitective.core.filter.commit.CommitLineImpactFilter
All Implemented Interfaces:
Cloneable, Iterable<CommitImpact>

public class CommitLineImpactFilter
extends CommitDiffEditFilter
implements Iterable<CommitImpact>

Filter that tracks the impact of commits measure in terms of lines changed


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
CommitLineImpactFilter()
          Create an impact filter that tracks the 10 most impacting commits
CommitLineImpactFilter(boolean detectRenames)
          Create an impact filter that tracks the 10 most impacting commits
CommitLineImpactFilter(boolean detectRenames, int limit)
          Create an impact filter that retains the given number of most impacting commits
CommitLineImpactFilter(int limit)
          Create an impact filter that retains the given number of most impacting commits
 
Method Summary
 org.eclipse.jgit.revwalk.filter.RevFilter clone()
          Clones this filter.
 SortedSet<CommitImpact> getCommits()
           
 int getLimit()
           
protected  boolean include(org.eclipse.jgit.revwalk.RevCommit commit, org.eclipse.jgit.diff.DiffEntry diff, org.eclipse.jgit.diff.Edit hunk)
          Handle the edit introduced by given commit.
 Iterator<CommitImpact> iterator()
           
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
 CommitFilter reset()
          Resets the filter state.
 
Methods inherited from class org.gitective.core.filter.commit.CommitDiffEditFilter
include, include
 
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
include, 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

CommitLineImpactFilter

public CommitLineImpactFilter(boolean detectRenames,
                              int limit)
Create an impact filter that retains the given number of most impacting commits

Parameters:
detectRenames -
limit -

CommitLineImpactFilter

public CommitLineImpactFilter(boolean detectRenames)
Create an impact filter that tracks the 10 most impacting commits

Parameters:
detectRenames -

CommitLineImpactFilter

public CommitLineImpactFilter()
Create an impact filter that tracks the 10 most impacting commits


CommitLineImpactFilter

public CommitLineImpactFilter(int limit)
Create an impact filter that retains the given number of most impacting commits

Parameters:
limit -
Method Detail

getLimit

public int getLimit()
Returns:
limit

getCommits

public SortedSet<CommitImpact> getCommits()
Returns:
commits

markStart

protected CommitDiffEditFilter markStart(org.eclipse.jgit.revwalk.RevCommit commit)
Description copied from class: CommitDiffEditFilter
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.

Overrides:
markStart in class CommitDiffEditFilter
Returns:
this filter

markEnd

protected CommitDiffEditFilter markEnd(org.eclipse.jgit.revwalk.RevCommit commit)
Description copied from class: CommitDiffEditFilter
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.

Overrides:
markEnd in class CommitDiffEditFilter
Returns:
this filter

include

protected boolean include(org.eclipse.jgit.revwalk.RevCommit commit,
                          org.eclipse.jgit.diff.DiffEntry diff,
                          org.eclipse.jgit.diff.Edit hunk)
Description copied from class: CommitDiffEditFilter
Handle the edit introduced by given commit.

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

Overrides:
include in class CommitDiffEditFilter
Parameters:
commit - non-null
diff - non-null
hunk - non-null
Returns:
true to continue, false to abort

clone

public org.eclipse.jgit.revwalk.filter.RevFilter clone()
Description copied from class: CommitFilter
Clones this filter.

The default implementation throws a UnsupportedOperationException and sub-classes should override if filter cloning is supported.

Overrides:
clone in class CommitFilter
See Also:
RevFilter.clone()

reset

public CommitFilter reset()
Description copied from class: CommitFilter
Resets the filter state. The base implementation does nothing by default and sub-classes should override if custom reset logic exists.

Overrides:
reset in class CommitFilter
Returns:
this filter

iterator

public Iterator<CommitImpact> iterator()
Specified by:
iterator in interface Iterable<CommitImpact>


Copyright © 2011-2012. All Rights Reserved.