org.gitective.core.filter.commit
Class DuplicateContainer

java.lang.Object
  extended by org.gitective.core.filter.commit.DuplicateContainer
All Implemented Interfaces:
Iterable<Map.Entry<org.eclipse.jgit.lib.AnyObjectId,List<String>>>

public class DuplicateContainer
extends Object
implements Iterable<Map.Entry<org.eclipse.jgit.lib.AnyObjectId,List<String>>>

Container class for duplicates found in commit walks


Field Summary
protected  org.eclipse.jgit.revwalk.RevCommit commit
          Commit
protected  Map<org.eclipse.jgit.lib.AnyObjectId,List<String>> objects
          Duplicate objects
 
Constructor Summary
protected DuplicateContainer(org.eclipse.jgit.revwalk.RevCommit commit)
          Create duplicate container
 
Method Summary
 org.eclipse.jgit.revwalk.RevCommit getCommit()
          Get commits that these duplicates occurred in
 Map<org.eclipse.jgit.lib.AnyObjectId,List<String>> getDuplicates()
          Get duplicate blobs ids mapped paths
 int getTotal()
          Get total number of duplicates
protected  DuplicateContainer include(org.eclipse.jgit.lib.AnyObjectId id, String path)
          Include id and path as possible duplicate
 Iterator<Map.Entry<org.eclipse.jgit.lib.AnyObjectId,List<String>>> iterator()
          Get iterator over all duplicate blobs
protected  boolean validate()
          Validate that this container contains at least one duplicate blob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commit

protected final org.eclipse.jgit.revwalk.RevCommit commit
Commit


objects

protected final Map<org.eclipse.jgit.lib.AnyObjectId,List<String>> objects
Duplicate objects

Constructor Detail

DuplicateContainer

protected DuplicateContainer(org.eclipse.jgit.revwalk.RevCommit commit)
Create duplicate container

Parameters:
commit -
Method Detail

include

protected DuplicateContainer include(org.eclipse.jgit.lib.AnyObjectId id,
                                     String path)
Include id and path as possible duplicate

Parameters:
id -
path -
Returns:
this container

validate

protected boolean validate()
Validate that this container contains at least one duplicate blob

Returns:
true if duplicates exist, false otherwise

getCommit

public org.eclipse.jgit.revwalk.RevCommit getCommit()
Get commits that these duplicates occurred in

Returns:
non-null commit

getDuplicates

public Map<org.eclipse.jgit.lib.AnyObjectId,List<String>> getDuplicates()
Get duplicate blobs ids mapped paths

Returns:
non-null and non-empty map of duplicates

iterator

public Iterator<Map.Entry<org.eclipse.jgit.lib.AnyObjectId,List<String>>> iterator()
Get iterator over all duplicate blobs

Specified by:
iterator in interface Iterable<Map.Entry<org.eclipse.jgit.lib.AnyObjectId,List<String>>>
Returns:
iterator over blobs and paths

getTotal

public int getTotal()
Get total number of duplicates

Returns:
total


Copyright © 2011-2012. All Rights Reserved.