/** @return the id of the last snapshot. */ public final int getLastSnapshotId() { final AbstractINodeDiff<N, A, D> last = getLast(); return last == null ? Snapshot.CURRENT_STATE_ID : last.getSnapshotId(); }
/** * Check if the latest snapshot diff exists. If not, add it. * @return the latest snapshot diff, which is never null. */ final D checkAndAddLatestSnapshotDiff(int latestSnapshotId, N currentINode) { final D last = getLast(); return (last != null && Snapshot.ID_INTEGER_COMPARATOR .compare(last.getSnapshotId(), latestSnapshotId) >= 0) ? last : addDiff(latestSnapshotId, currentINode); }
/** Append the diff at the end of the list. */ private D addLast(D diff) { createDiffsIfNeeded(); final D last = getLast(); diffs.addLast(diff); if (last != null) { last.setPosterior(diff); } return diff; }
/** Append the diff at the end of the list. */ private final D addLast(D diff) { final D last = getLast(); diffs.add(diff); if (last != null) { last.setPosterior(diff); } return diff; }
/** @return the id of the last snapshot. */ public final int getLastSnapshotId() { final AbstractINodeDiff<N, A, D> last = getLast(); return last == null ? Snapshot.CURRENT_STATE_ID : last.getSnapshotId(); }
/** Append the diff at the end of the list. */ private final D addLast(D diff) { final D last = getLast(); diffs.add(diff); if (last != null) { last.setPosterior(diff); } return diff; }
/** @return the id of the last snapshot. */ public final int getLastSnapshotId() { final AbstractINodeDiff<N, A, D> last = getLast(); return last == null ? Snapshot.CURRENT_STATE_ID : last.getSnapshotId(); }
/** * Check if the latest snapshot diff exists. If not, add it. * @return the latest snapshot diff, which is never null. */ final D checkAndAddLatestSnapshotDiff(int latestSnapshotId, N currentINode) { final D last = getLast(); return (last != null && Snapshot.ID_INTEGER_COMPARATOR .compare(last.getSnapshotId(), latestSnapshotId) >= 0) ? last : addDiff(latestSnapshotId, currentINode); }
/** * Check if the latest snapshot diff exists. If not, add it. * @return the latest snapshot diff, which is never null. */ final D checkAndAddLatestSnapshotDiff(int latestSnapshotId, N currentINode) { final D last = getLast(); return (last != null && Snapshot.ID_INTEGER_COMPARATOR .compare(last.getSnapshotId(), latestSnapshotId) >= 0) ? last : addDiff(latestSnapshotId, currentINode); }