uka.patch
Class PatchWriter

java.lang.Object
  extended byuka.patch.AbstractPatchWriter
      extended byuka.patch.PatchWriter
All Implemented Interfaces:
Constants

public class PatchWriter
extends AbstractPatchWriter

Implements the encoding methods of AbstractPatchWriter and defines a concrete patch protocol. The protocol written with this class can be parsed with the PatchReader class.


Field Summary
(package private)  LayeredObjectSpace layeredObjectSpace
           
(package private)  MarshalStream out
           
 
Fields inherited from class uka.patch.AbstractPatchWriter
currentID, modified, unmodifiedCnt
 
Fields inherited from interface uka.patch.Constants
CODE_BOOLEAN, CODE_DOUBLE, CODE_END_OF_PATCH, CODE_FLOAT, CODE_INT16, CODE_INT32, CODE_INT64, CODE_INT8, CODE_NOT_MODIFIED, CODE_NULL, CODE_PATCH_HEADER, CODE_REFERENCE, MAX_DISTRIBUTION_RECORDS
 
Constructor Summary
PatchWriter(ObjectSpace objects)
           
 
Method Summary
 void beginPatch()
           
 void clear()
           
protected  void encode(boolean value)
           
protected  void encode(byte value)
           
protected  void encode(char value)
           
protected  void encode(double value)
           
protected  void encode(float value)
           
protected  void encode(int value)
           
protected  void encode(long value)
           
protected  void encode(short value)
           
protected  void encodeBeginPatch()
           
protected  void encodeEndPatch()
           
protected  void encodeNull()
           
protected  void encodePatchHeader(int id)
           
protected  java.lang.Object encodeReference(java.lang.Object ref)
           
protected  void encodeUnmodifiedCnt(int cnt)
           
 void endPatch()
           
 void flush()
           
 MarshalStream getMarshalStream()
           
 MarshalStream getOutput(int rank)
          Experimental low-level API: Patch creation for the expert.
 void init(java.lang.Object root)
           
 void installOverlay()
           
 void rawWriteInt(int value)
           
 void setMarshalStream(MarshalStream out)
           
 void uninstallOverlay()
           
 
Methods inherited from class uka.patch.AbstractPatchWriter
beginPatchRecord, endPatchRecord, flushUnmodified, write, write, write, write, write, write, write, write, writeNotModified, writeNull, writeReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

MarshalStream out

layeredObjectSpace

LayeredObjectSpace layeredObjectSpace
Constructor Detail

PatchWriter

public PatchWriter(ObjectSpace objects)
            throws java.io.IOException
Method Detail

setMarshalStream

public void setMarshalStream(MarshalStream out)

getMarshalStream

public MarshalStream getMarshalStream()

init

public void init(java.lang.Object root)
Specified by:
init in class AbstractPatchWriter

beginPatch

public void beginPatch()
                throws java.io.IOException
Specified by:
beginPatch in class AbstractPatchWriter
Throws:
java.io.IOException

endPatch

public void endPatch()
              throws java.io.IOException
Specified by:
endPatch in class AbstractPatchWriter
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Throws:
java.io.IOException

clear

public void clear()
Specified by:
clear in class AbstractPatchWriter

installOverlay

public void installOverlay()

uninstallOverlay

public void uninstallOverlay()

encodeBeginPatch

protected void encodeBeginPatch()
                         throws java.io.IOException
Specified by:
encodeBeginPatch in class AbstractPatchWriter
Throws:
java.io.IOException

encodeEndPatch

protected void encodeEndPatch()
                       throws java.io.IOException
Specified by:
encodeEndPatch in class AbstractPatchWriter
Throws:
java.io.IOException

encodePatchHeader

protected void encodePatchHeader(int id)
                          throws java.io.IOException
Specified by:
encodePatchHeader in class AbstractPatchWriter
Throws:
java.io.IOException

encodeUnmodifiedCnt

protected void encodeUnmodifiedCnt(int cnt)
                            throws java.io.IOException
Specified by:
encodeUnmodifiedCnt in class AbstractPatchWriter
Throws:
java.io.IOException

encodeNull

protected void encodeNull()
                   throws java.io.IOException
Specified by:
encodeNull in class AbstractPatchWriter
Throws:
java.io.IOException

encodeReference

protected java.lang.Object encodeReference(java.lang.Object ref)
                                    throws java.io.IOException
Specified by:
encodeReference in class AbstractPatchWriter
Throws:
java.io.IOException

encode

protected void encode(boolean value)
               throws java.io.IOException
Specified by:
encode in class AbstractPatchWriter
Throws:
java.io.IOException

encode

protected void encode(byte value)
               throws java.io.IOException
Specified by:
encode in class AbstractPatchWriter
Throws:
java.io.IOException

encode

protected void encode(char value)
               throws java.io.IOException
Specified by:
encode in class AbstractPatchWriter
Throws:
java.io.IOException

encode

protected void encode(short value)
               throws java.io.IOException
Specified by:
encode in class AbstractPatchWriter
Throws:
java.io.IOException

encode

protected void encode(int value)
               throws java.io.IOException
Specified by:
encode in class AbstractPatchWriter
Throws:
java.io.IOException

encode

protected void encode(float value)
               throws java.io.IOException
Specified by:
encode in class AbstractPatchWriter
Throws:
java.io.IOException

encode

protected void encode(long value)
               throws java.io.IOException
Specified by:
encode in class AbstractPatchWriter
Throws:
java.io.IOException

encode

protected void encode(double value)
               throws java.io.IOException
Specified by:
encode in class AbstractPatchWriter
Throws:
java.io.IOException

rawWriteInt

public void rawWriteInt(int value)
                 throws java.io.IOException
Specified by:
rawWriteInt in class AbstractPatchWriter
Throws:
java.io.IOException

getOutput

public MarshalStream getOutput(int rank)
                        throws java.io.IOException
Experimental low-level API: Patch creation for the expert.

Specified by:
getOutput in class AbstractPatchWriter
Throws:
java.io.IOException