public List<String> getAuthors() { List<String> authors = new LinkedList<String>(); for (LogEntry logEntry : logEntries) { if (!authors.contains(logEntry.getAuthor())) { authors.add(logEntry.getAuthor()); } } Collections.sort(authors); return authors; }
public void removeEntriesWithPathForAuthor(String path, String author) { if (logEntries == null || logEntries.isEmpty()) { return; } int count = logEntries.size(); int i = 0; while (i < count) { LogEntry logEntry = logEntries.get(i); if (!logEntry.getAuthor().equals(author)) { i++; continue; } logEntry.removeEntriesWithPath(path); if (logEntry.isEmpty()) { logEntries.remove(logEntry); count--; continue; } i++; } isOrdered = false; }
private List<LogEntry> getUnorderedAuthorLogEntries(String author) { List<LogEntry> entries = new LinkedList<LogEntry>(); for (LogEntry logEntry : logEntries) { if (logEntry.getAuthor().equals(author)) { entries.add(logEntry); } } return entries; }
public LogReport getLogReportForAuthor(String author) { LogReport report = new LogReport(); for (LogEntry entry : logEntries) { if (entry.getAuthor().equals(author)) { report.addLogEntry(entry); } } return report.isEmpty() ? null : report; }
public boolean hasSamePathEntryWithHigherRevisionForAuthor(PathEntry pathEntry, String author) { for (LogEntry logEntry : logEntries) { if (!logEntry.getAuthor().equals(author) || logEntry.getRevision() < pathEntry.getRevision()) { continue; } List<PathEntry> pathEntries = logEntry.getPathEntries(); for (PathEntry _pathEntry : pathEntries) { if (_pathEntry.getPath().equals(pathEntry.getPath()) && _pathEntry.getAction().equals(pathEntry.getAction())) { return true; } } } return false; }