org.xwiki.diff.display
Class UnifiedDiffBlock<E,F>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<UnifiedDiffElement<E,F>>
org.xwiki.diff.display.UnifiedDiffBlock<E,F>
- Type Parameters:
E
- the type of elements that are compared to produce the first level diffF
- the type of sub-element that are compared to produce the second level diff
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<UnifiedDiffElement<E,F>>, Collection<UnifiedDiffElement<E,F>>, List<UnifiedDiffElement<E,F>>, RandomAccess
public class UnifiedDiffBlock<E,F>
- extends ArrayList<UnifiedDiffElement<E,F>>
Represents a list of UnifiedDiffElement
s that share the same context. The context is defined based on the
distance between changes. Changes that are close to each other are grouped in a single block. A block can contain
both added and removed elements. Blocks also contain unmodified elements that put changes in context.
- Since:
- 4.1RC1
- See Also:
- Serialized Form
Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
UnifiedDiffBlock
public UnifiedDiffBlock()
getPreviousStart
public int getPreviousStart()
- Returns:
- the index where this block starts in the previous version; since blocks are most of the time not empty,
the returned value is the index of the first unmodified or removed element in this group
getPreviousSize
public int getPreviousSize()
- Returns:
- the size of this block (number of elements) in the previous version; unmodified elements and elements
marked as removed are counted only
getNextStart
public int getNextStart()
- Returns:
- the index where this block starts in the next version; since blocks are most of the time not empty, the
returned value is the index of the first unmodified or added element in this group
getNextSize
public int getNextSize()
- Returns:
- the size of this block (number of elements) in the next version; unmodified elements and elements marked
as added are counted only
toString
public String toString()
- Overrides:
toString
in class AbstractCollection<UnifiedDiffElement<E,F>>