gzz.impl
Class SingleSlicer

java.lang.Object
  |
  +--gzz.impl.SingleSlicer
All Implemented Interfaces:
Slicer

public class SingleSlicer
extends java.lang.Object
implements Slicer

A Slicer for spaces containing only a single slice. (May get rid of this once we have a Slicer that can manage more than a single slice... ;-))


Field Summary
protected  java.lang.String sliceId
          The String id of our slice.
protected  Space space
           
 
Constructor Summary
SingleSlicer(java.lang.String sliceId)
           
 
Method Summary
protected  SliceVersion export()
           
 SliceVersion export(java.lang.String slice)
          Create a SliceVersion for a given slice.
 java.util.Map exportAll()
          Create SliceVersions for all slices.
 java.lang.String getSlice0()
          Get the String id of the slice 0 (s.0) of this space.
 java.util.Set getSlices()
          Get the String ids of the slices that are currently swapped in.
 void setSpace(Space space)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

space

protected Space space

sliceId

protected java.lang.String sliceId
The String id of our slice.

Constructor Detail

SingleSlicer

public SingleSlicer(java.lang.String sliceId)
Method Detail

setSpace

public void setSpace(Space space)
Specified by:
setSpace in interface Slicer

getSlice0

public java.lang.String getSlice0()
Description copied from interface: Slicer
Get the String id of the slice 0 (s.0) of this space. Slice 0 is the "main" slice.

Specified by:
getSlice0 in interface Slicer

getSlices

public java.util.Set getSlices()
Description copied from interface: Slicer
Get the String ids of the slices that are currently swapped in. Returns a Set of String ids.

Specified by:
getSlices in interface Slicer

export

public SliceVersion export(java.lang.String slice)
Description copied from interface: Slicer
Create a SliceVersion for a given slice. Returns the current version of a slice, as a serializable object.

NOTE: The SliceVersion returned may contain unsaved spans; the SliceVersion will not be serializable if not all spans in it are saved first.

Specified by:
export in interface Slicer
See Also:
gzz.SliceVersion

exportAll

public java.util.Map exportAll()
Description copied from interface: Slicer
Create SliceVersions for all slices. Returns a Map from slice String ids to serializable SliceVersion representation of the respective slice.

NOTE: The SliceVersion returned may contain unsaved spans; the SliceVersion will not be serializable if not all spans in it are saved first.

Specified by:
exportAll in interface Slicer
See Also:
gzz.SliceVersion

export

protected SliceVersion export()