@Override public String toString() { return getClass().getSimpleName() + ": " + this.getSnapshotId() + " (post=" + (posteriorDiff == null? null: posteriorDiff.getSnapshotId()) + ")"; }
/** * Search for the snapshot whose id is 1) no less than the given id, * and 2) most close to the given id. */ public final int getSnapshotById(final int snapshotId) { D diff = getDiffById(snapshotId); return diff == null ? Snapshot.CURRENT_STATE_ID : diff.getSnapshotId(); }
/** @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); }
} else { int priorIndex = i > 0 ? i - 1 : -i - 2; return diffs.get(priorIndex).getSnapshotId(); return diffs.get(i).getSnapshotId(); } else if (i < -1) { return diffs.get(-i - 2).getSnapshotId(); } else { // i == -1 return Snapshot.NO_SNAPSHOT_ID;
@Override public String toString() { return getClass().getSimpleName() + ": " + this.getSnapshotId() + " (post=" + (posteriorDiff == null? null: posteriorDiff.getSnapshotId()) + ")"; }
@Override public String toString() { return getClass().getSimpleName() + ": " + this.getSnapshotId() + " (post=" + (posteriorDiff == null? null: posteriorDiff.getSnapshotId()) + ")"; }
/** @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(); }
/** @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(); }
/** * Search for the snapshot whose id is 1) no less than the given id, * and 2) most close to the given id. */ public final int getSnapshotById(final int snapshotId) { D diff = getDiffById(snapshotId); return diff == null ? Snapshot.CURRENT_STATE_ID : diff.getSnapshotId(); }
/** * Search for the snapshot whose id is 1) no less than the given id, * and 2) most close to the given id. */ public final int getSnapshotById(final int snapshotId) { D diff = getDiffById(snapshotId); return diff == null ? Snapshot.CURRENT_STATE_ID : diff.getSnapshotId(); }
if (previous.getSnapshotId() != prior) { diffs.get(snapshotIndex).setSnapshotId(prior); } else {
} else { int priorIndex = i > 0 ? i - 1 : -i - 2; return diffs.get(priorIndex).getSnapshotId(); return diffs.get(i).getSnapshotId(); } else if (i < -1) { return diffs.get(-i - 2).getSnapshotId(); } else { // i == -1 return Snapshot.NO_SNAPSHOT_ID;
} else { int priorIndex = i > 0 ? i - 1 : -i - 2; return diffs.get(priorIndex).getSnapshotId(); return diffs.get(i).getSnapshotId(); } else if (i < -1) { return diffs.get(-i - 2).getSnapshotId(); } else { // i == -1 return Snapshot.NO_SNAPSHOT_ID;
/** * 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); }
if (previous.getSnapshotId() != prior) { diffs.get(snapshotIndex).setSnapshotId(prior); } else {
if (previous.getSnapshotId() != prior) { diffs.get(snapshotIndex).setSnapshotId(prior); } else {