uka.patch
Interface PatchInput

All Known Implementing Classes:
PatchReader

public interface PatchInput

Interface for reading patches in an abstract way and applying them to patchable objects.


Method Summary
 void applyPatchAnonymous(java.lang.Object r, java.lang.Object c)
           
 boolean getDiffAsBoolean()
           
 byte getDiffAsByte()
           
 char getDiffAsChar()
           
 double getDiffAsDouble()
           
 float getDiffAsFloat()
           
 int getDiffAsInt()
          Reads the updated value, if a patch record is available.
 long getDiffAsLong()
           
 java.lang.Object getDiffAsObject()
          Reads the updated reference value, if the last call to hasDiff() returned true.
 short getDiffAsShort()
           
 int getFromRank()
          Experimental low-level API.
 UnmarshalStream getInput()
          Experimental low-level API.
 boolean hasDiff()
          Checks whether there is a patch record available for the next instance variable.
 

Method Detail

hasDiff

public boolean hasDiff()
                throws java.io.IOException,
                       java.lang.ClassNotFoundException
Checks whether there is a patch record available for the next instance variable.

Throws:
java.io.IOException
java.lang.ClassNotFoundException
See Also:
Patchable.applyPatch(java.lang.Object, uka.patch.PatchInput)

getDiffAsBoolean

public boolean getDiffAsBoolean()
                         throws java.io.IOException
Throws:
java.io.IOException
See Also:
getDiffAsInt()

getDiffAsByte

public byte getDiffAsByte()
                   throws java.io.IOException
Throws:
java.io.IOException
See Also:
getDiffAsInt()

getDiffAsChar

public char getDiffAsChar()
                   throws java.io.IOException
Throws:
java.io.IOException
See Also:
getDiffAsInt()

getDiffAsShort

public short getDiffAsShort()
                     throws java.io.IOException
Throws:
java.io.IOException
See Also:
getDiffAsInt()

getDiffAsInt

public int getDiffAsInt()
                 throws java.io.IOException
Reads the updated value, if a patch record is available.

Throws:
java.io.IOException
See Also:
hasDiff(), Patchable.applyPatch(java.lang.Object, uka.patch.PatchInput)

getDiffAsFloat

public float getDiffAsFloat()
                     throws java.io.IOException
Throws:
java.io.IOException
See Also:
getDiffAsInt()

getDiffAsLong

public long getDiffAsLong()
                   throws java.io.IOException
Throws:
java.io.IOException
See Also:
getDiffAsInt()

getDiffAsDouble

public double getDiffAsDouble()
                       throws java.io.IOException
Throws:
java.io.IOException
See Also:
getDiffAsInt()

getDiffAsObject

public java.lang.Object getDiffAsObject()
                                 throws java.io.IOException,
                                        java.lang.ClassNotFoundException
Reads the updated reference value, if the last call to hasDiff() returned true. The returned object reference is assigned to the currently patched instance variable of the patchable object and the corresponding instance variable of its backup copy.

Throws:
java.io.IOException
java.lang.ClassNotFoundException

applyPatchAnonymous

public void applyPatchAnonymous(java.lang.Object r,
                                java.lang.Object c)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

getInput

public UnmarshalStream getInput()
                         throws java.io.IOException
Experimental low-level API.

Returns:
the underlying stream for raw unmarshaling.
Throws:
java.io.IOException

getFromRank

public int getFromRank()
                throws java.io.IOException
Experimental low-level API.

Returns:
the rank that sent the corresponding patch.
Throws:
java.io.IOException