org.xwiki.diff
Interface Delta<E>

Type Parameters:
E - the type of compared elements

public interface Delta<E>

A delta between two version of a list.

Version:
$Id: d451e7339ecf473cd39d91246cba1674bb102dff $

Nested Class Summary
static class Delta.Type
          The kind of modification to apply on the list.
 
Method Summary
 void apply(List<E> target)
          Apply the delta on the provided list.
 Chunk<E> getNext()
           
 Chunk<E> getPrevious()
           
 Delta.Type getType()
           
 void restore(List<E> target)
          Apply the an inverted version of the delta on the provided list.
 void verify(List<E> target)
          Try to apply the delta on the provided list.
 

Method Detail

verify

void verify(List<E> target)
            throws PatchException
Try to apply the delta on the provided list.

Parameters:
target - the list to modify
Throws:
PatchException - if the delta cannot be applied

apply

void apply(List<E> target)
           throws PatchException
Apply the delta on the provided list.

Parameters:
target - the list to modify
Throws:
PatchException - if the delta cannot be applied

restore

void restore(List<E> target)
             throws PatchException
Apply the an inverted version of the delta on the provided list.

Parameters:
target - the list to modify
Throws:
PatchException - if the delta cannot be applied

getType

Delta.Type getType()
Returns:
the type of modification applied to the list

getPrevious

Chunk<E> getPrevious()
Returns:
the chunk before the modification

getNext

Chunk<E> getNext()
Returns:
the chunk after the modification


Copyright © 2004–2014 XWiki. All rights reserved.