com.threerings.delta
Class Delta

java.lang.Object
  extended by com.threerings.delta.Delta
All Implemented Interfaces:
com.threerings.io.Streamable
Direct Known Subclasses:
ArrayDelta, ReflectiveDelta

public abstract class Delta
extends Object
implements com.threerings.io.Streamable

Represents a set of changes that may be applied to an existing object to create a new object (with a streamed form that is more compact than that which would be required for streaming the entire new object).


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
com.threerings.io.Streamable.Closure
 
Constructor Summary
Delta()
           
 
Method Summary
abstract  Object apply(Object original)
          Applies this delta to the specified object.
static boolean checkDeltable(Object original, Object revised)
          Determines whether it is possible to create a Delta converting the original object to the revised object.
static Delta createDelta(Object original, Object revised)
          Creates and returns a new Delta that will convert the original object to the revised object.
abstract  Delta merge(Delta other)
          Merges this delta with another.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Delta

public Delta()
Method Detail

checkDeltable

public static boolean checkDeltable(Object original,
                                    Object revised)
Determines whether it is possible to create a Delta converting the original object to the revised object.


createDelta

public static Delta createDelta(Object original,
                                Object revised)
Creates and returns a new Delta that will convert the original object to the revised object.


apply

public abstract Object apply(Object original)
Applies this delta to the specified object.

Returns:
a new object incorporating the changes represented by this delta.

merge

public abstract Delta merge(Delta other)
Merges this delta with another.

Returns:
a new delta containing the changes included in both.


Copyright © 2011. All Rights Reserved.