org.gitective.core.filter.commit
Class DateFilter

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.DateFilter
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
AuthorDateFilter, CommitterDateFilter

public abstract class DateFilter
extends CommitFilter

Commit filter that includes commits until one is encountered that returns a date from getDate(RevCommit) that has occurred before the configured date.


Field Summary
protected  long time
          Time
 
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
DateFilter(Date date)
          Create a date filter for a given date
DateFilter(long time)
          Create a date filter for a given time
 
Method Summary
protected abstract  Date getDate(org.eclipse.jgit.revwalk.RevCommit commit)
          Get a date from the commit to compare against
protected  Date getWhen(org.eclipse.jgit.lib.PersonIdent person)
          Get the date from a given PersonIdent
 boolean include(org.eclipse.jgit.revwalk.RevWalk walker, org.eclipse.jgit.revwalk.RevCommit commit)
           
 
Methods inherited from class org.gitective.core.filter.commit.CommitFilter
clone, include, reset, 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
 

Field Detail

time

protected final long time
Time

Constructor Detail

DateFilter

public DateFilter(long time)
Create a date filter for a given time

Parameters:
time -

DateFilter

public DateFilter(Date date)
Create a date filter for a given date

Parameters:
date - must be non-null
Method Detail

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

getWhen

protected Date getWhen(org.eclipse.jgit.lib.PersonIdent person)
Get the date from a given PersonIdent

Parameters:
person -
Returns:
date or null if given person is null

getDate

protected abstract Date getDate(org.eclipse.jgit.revwalk.RevCommit commit)
Get a date from the commit to compare against

Parameters:
commit -
Returns:
date


Copyright © 2011-2012. All Rights Reserved.