| | |
| | | /**
|
| | | * Model class to represent the commit activity across many repositories. This
|
| | | * class is used by the Activity page.
|
| | | * |
| | | *
|
| | | * @author James Moger
|
| | | */
|
| | | public class Activity implements Serializable, Comparable<Activity> {
|
| | |
| | | public final Date startDate;
|
| | |
|
| | | public final Date endDate;
|
| | | |
| | |
|
| | | private final Set<RepositoryCommit> commits;
|
| | |
|
| | | private final Map<String, Metric> authorMetrics;
|
| | |
| | |
|
| | | /**
|
| | | * Constructor for one day of activity.
|
| | | * |
| | | *
|
| | | * @param date
|
| | | */
|
| | | public Activity(Date date) {
|
| | |
| | |
|
| | | /**
|
| | | * Constructor for specified duration of activity from start date.
|
| | | * |
| | | *
|
| | | * @param date
|
| | | * the start date of the activity
|
| | | * @param duration
|
| | |
| | | repositoryMetrics = new HashMap<String, Metric>();
|
| | | authorExclusions = new TreeSet<String>();
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * Exclude the specified authors from the metrics.
|
| | | * |
| | | *
|
| | | * @param authors
|
| | | */
|
| | | public void excludeAuthors(Collection<String> authors) {
|
| | |
| | | /**
|
| | | * Adds a commit to the activity object as long as the commit is not a
|
| | | * duplicate.
|
| | | * |
| | | *
|
| | | * @param repository
|
| | | * @param branch
|
| | | * @param commit
|
| | |
| | | /**
|
| | | * Adds a commit to the activity object as long as the commit is not a
|
| | | * duplicate.
|
| | | * |
| | | *
|
| | | * @param repository
|
| | | * @param branch
|
| | | * @param commit
|
| | |
| | | public int getCommitCount() {
|
| | | return commits.size();
|
| | | }
|
| | | |
| | |
|
| | | public List<RepositoryCommit> getCommits() {
|
| | | List<RepositoryCommit> list = new ArrayList<RepositoryCommit>(commits);
|
| | | Collections.sort(list);
|