org.xwiki.diff.display
Class InlineDiffChunk<E>

java.lang.Object
  extended by org.xwiki.diff.display.InlineDiffChunk<E>
Type Parameters:
E - the type of elements that form a chunk

public class InlineDiffChunk<E>
extends Object

A group of consecutive elements that are targeted by the same operation (add, remove, keep) in an in-line diff.

Since:
4.1RC1

Nested Class Summary
static class InlineDiffChunk.Type
          The possible types of chunks you can find within an in-line diff.
 
Constructor Summary
InlineDiffChunk(InlineDiffChunk.Type type, List<E> elements)
          Creates a new chunk with the specified type and elements.
 
Method Summary
 List<E> getElements()
           
 InlineDiffChunk.Type getType()
           
 boolean isAdded()
           
 boolean isDeleted()
           
 boolean isUnmodified()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InlineDiffChunk

public InlineDiffChunk(InlineDiffChunk.Type type,
                       List<E> elements)
Creates a new chunk with the specified type and elements.

Parameters:
type - the chunk type
elements - the list of elements that form the chunk
Method Detail

getType

public InlineDiffChunk.Type getType()
Returns:
the chunk type

getElements

public List<E> getElements()
Returns:
the list of element that form this chunk

isAdded

public boolean isAdded()
Returns:
true if this chunk was added, false otherwise

isDeleted

public boolean isDeleted()
Returns:
true if this chunk was deleted, false otherwise

isUnmodified

public boolean isUnmodified()
Returns:
true if this chunk was left unmodified, false otherwise

toString

public String toString()
Overrides:
toString in class Object