gzz.slices
Class SliceVersion

java.lang.Object
  |
  +--gzz.slices.SliceVersion
All Implemented Interfaces:
java.io.Serializable, Version

public class SliceVersion
extends java.lang.Object
implements java.io.Serializable, Version

A version of a slice. (Note that as Gzz currently doesn't support multiple slices, you can think of this as "a version of a space.") This is immutable and can be serialized for saving.

See Also:
SliceVersion.Diff, Serialized Form

Nested Class Summary
static class SliceVersion.Conn
          A serializable representation of a single ZZ connection.
static class SliceVersion.Diff
          A diff between two SliceVersions.
 
Nested classes inherited from class gzz.util.Version
 
Field Summary
 java.util.Set connections
          The connections in this version.
 java.util.Map contents
          The cell contents in this version.
static boolean dbg
           
static SliceVersion EMPTY_VERSION
           
static java.lang.String rcsid
           
 
Constructor Summary
SliceVersion(java.util.Set connections, java.util.Map contents)
          Create a new SliceVersion given the connections and cell contents in that version.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 Version.Diff getDiffFrom(Version previous)
          Return the diff from a previous to this version.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

rcsid

public static final java.lang.String rcsid
See Also:
Constant Field Values

dbg

public static boolean dbg

EMPTY_VERSION

public static final SliceVersion EMPTY_VERSION

connections

public final java.util.Set connections
The connections in this version. Contains Conn objects.


contents

public final java.util.Map contents
The cell contents in this version. Maps String cell ids to arbitrary serializable objects representing the cell content.

Constructor Detail

SliceVersion

public SliceVersion(java.util.Set connections,
                    java.util.Map contents)
             throws gzz.errors.ZZAlreadyConnectedException
Create a new SliceVersion given the connections and cell contents in that version. This checks the connections for consistency, because we want to be sure we don't save bad data to the disk.

Throws:
gzz.errors.ZZAlreadyConnectedException - if there is more than one Conn object for the same cell, dimension and direction.
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getDiffFrom

public Version.Diff getDiffFrom(Version previous)
Description copied from interface: Version
Return the diff from a previous to this version. previous must be a Version of the same kind as this one.

Specified by:
getDiffFrom in interface Version

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object