org.gitective.core.filter.commit
Class CommitLimitFilter

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.CommitLimitFilter
All Implemented Interfaces:
Cloneable

public class CommitLimitFilter
extends CommitFilter

Filter that stops including commits after a certain number of commits are considered. This class should be last in an AndCommitFilter if you want to only limit matched commits and not just all visited commits.


Field Summary
 
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
CommitLimitFilter(long limit)
          Create a limit filter
 
Method Summary
 org.eclipse.jgit.revwalk.filter.RevFilter clone()
          Clones this filter.
 long getLimit()
          Get configured limit
 boolean include(org.eclipse.jgit.revwalk.RevWalk walker, org.eclipse.jgit.revwalk.RevCommit commit)
           
 CommitFilter reset()
          Resets the filter state.
 
Methods inherited from class org.gitective.core.filter.commit.CommitFilter
include, setRepository, 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

CommitLimitFilter

public CommitLimitFilter(long limit)
Create a limit filter

Parameters:
limit -
Method Detail

getLimit

public long getLimit()
Get configured limit

Returns:
limit

include

public boolean include(org.eclipse.jgit.revwalk.RevWalk walker,
                       org.eclipse.jgit.revwalk.RevCommit commit)
                throws IOException
Specified by:
include in class org.eclipse.jgit.revwalk.filter.RevFilter
Throws:
IOException

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

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()


Copyright © 2011-2012. All Rights Reserved.