|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gzz.slices.SliceVersion.Diff
A diff between two SliceVersion
s.
Field Summary | |
java.util.Set |
connects
The set of Conn objects created by this diff. |
java.util.Map |
contents
The cell contents set by this diff. |
java.util.Set |
disconnects
The set of Conn objects removed by this diff. |
java.util.Map |
discontents
The cell contents unset by this diff. |
Constructor Summary | |
SliceVersion.Diff(java.util.Set connects,
java.util.Set disconnects,
java.util.Map contents,
java.util.Map discontents)
Create a new Diff by giving the fields of the
object. |
|
SliceVersion.Diff(SliceVersion old,
SliceVersion nu)
Create a new Diff by comparing an 'old' against
a 'new' SliceVersion |
Method Summary | |
Version |
applyTo(Version _old)
Apply the diff to a SliceVersion and return
the result. |
Version.Diff |
inverse()
Return the inverse of this diff. |
boolean |
isEmpty()
Whether this is the empty diff. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public final java.util.Set connects
Conn
objects created by this diff.
public final java.util.Set disconnects
Conn
objects removed by this diff.
public final java.util.Map contents
SliceVersion
.
public final java.util.Map discontents
connects
map.
This is the inverse of the contents map: if cell C had
content A before and content B after the diff, C will be
mapped to B in contents but to A in discontents.
Constructor Detail |
public SliceVersion.Diff(SliceVersion old, SliceVersion nu)
Diff
by comparing an 'old' against
a 'new' SliceVersion. For all
SliceVersion
s o
and n
,
it must hold that: Diff(o, n).applyTo(o) == n
and Diff(o, n).inverse().applyTo(n) == o
.
Note: We do not do consistency checking because we believe
the SliceVersion
s to be consistent, and our
simple diffing algorithm to be sound.
public SliceVersion.Diff(java.util.Set connects, java.util.Set disconnects, java.util.Map contents, java.util.Map discontents)
Diff
by giving the fields of the
object. This is private because we do not check.
Method Detail |
public Version.Diff inverse()
inverse
in interface Version.Diff
public Version applyTo(Version _old)
SliceVersion
and return
the result.
applyTo
in interface Version.Diff
public boolean isEmpty()
Version.Diff
v.equals(diff.applyTo(v))
for all Version
s v
and
Version.Diff
s diff
of the
matching kind, iff diff.isEmpty()
.
We need this method because we never want to save empty diffs...
isEmpty
in interface Version.Diff
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |