org.xwiki.diff.internal
Class AbstractDelta<E>

java.lang.Object
  extended by org.xwiki.diff.internal.AbstractDelta<E>
Type Parameters:
E - the type of compared elements
All Implemented Interfaces:
Delta<E>
Direct Known Subclasses:
ChangeDelta, DeleteDelta, InsertDelta

public abstract class AbstractDelta<E>
extends Object
implements Delta<E>

Base class used for various types of Deltas.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.xwiki.diff.Delta
Delta.Type
 
Constructor Summary
AbstractDelta(Chunk<E> previous, Chunk<E> next, Delta.Type type)
           
AbstractDelta(difflib.Chunk original, difflib.Chunk revised, Delta.Type type)
           
 
Method Summary
 boolean equals(Object obj)
           
 Chunk<E> getNext()
           
 Chunk<E> getPrevious()
           
 Delta.Type getType()
           
 int hashCode()
           
 void setNext(Chunk<E> next)
           
 void setPrevious(Chunk<E> previous)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xwiki.diff.Delta
apply, restore, verify
 

Constructor Detail

AbstractDelta

public AbstractDelta(Chunk<E> previous,
                     Chunk<E> next,
                     Delta.Type type)
Parameters:
previous - the chunk before the modification
next - the chunk after the modification
type - the type of modification applied to the list

AbstractDelta

public AbstractDelta(difflib.Chunk original,
                     difflib.Chunk revised,
                     Delta.Type type)
Parameters:
original - the chunk before the modification
revised - the chunk after the modification
type - the type of modification applied to the list
Method Detail

getType

public Delta.Type getType()
Specified by:
getType in interface Delta<E>
Returns:
the type of modification applied to the list

getPrevious

public Chunk<E> getPrevious()
Specified by:
getPrevious in interface Delta<E>
Returns:
the chunk before the modification

setPrevious

public void setPrevious(Chunk<E> previous)
Parameters:
previous - the chunk before the modification

getNext

public Chunk<E> getNext()
Specified by:
getNext in interface Delta<E>
Returns:
the chunk after the modification

setNext

public void setNext(Chunk<E> next)
Parameters:
next - the chunk after the modification

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object