gzz.util
Interface Version.Diff

All Known Implementing Classes:
SliceVersion.Diff
Enclosing interface:
Version

public static interface Version.Diff

A diff between two Versions. It must hold that w.getDiffFrom(v).applyTo(v).equals(w) for all Versions v and w of the same kind.


Method Summary
 Version applyTo(Version old)
          Apply the diff to a Version and return the result.
 Version.Diff inverse()
          Return the inverse of this diff.
 boolean isEmpty()
          Whether this is the empty diff.
 

Method Detail

inverse

public Version.Diff inverse()
Return the inverse of this diff.


applyTo

public Version applyTo(Version old)
Apply the diff to a Version and return the result. The Version must be of the same kind as the Versions this diff was generated from.


isEmpty

public boolean isEmpty()
Whether this is the empty diff. It must hold that v.equals(diff.applyTo(v)) for all Versions v and Version.Diffs diff of the matching kind, iff diff.isEmpty().

We need this method because we never want to save empty diffs...