Class UnifiedDiffBlock<E,​F>

  • Type Parameters:
    E - the type of elements that are compared to produce the first level diff
    F - 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 UnifiedDiffElements 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
    Version:
    $Id: dbabad58f7203345ace61bc95d92a578ff65e056 $
    See Also:
    Serialized Form
    • Constructor Detail

      • UnifiedDiffBlock

        public UnifiedDiffBlock()
    • Method Detail

      • 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
      • isConflicting

        public boolean isConflicting()
        Returns:
        true if this block is part of a conflict.
        Since:
        11.7RC1
      • setConflict

        public void setConflict​(Conflict<E> conflict)
        Sets the conflict related to this block element.
        Parameters:
        conflict - the conflict to be registered.
        Since:
        11.8RC1