Interface Chunk<E>

  • Type Parameters:
    E - the type of compared elements

    public interface Chunk<E>
    A snippet of the source list.
    Version:
    $Id: bd66897f4503e254e4ff0611871818b76fe32e82 $
    • Method Detail

      • verify

        void verify​(List<E> target)
             throws PatchException
        Verify that the chunk can be found in the provided list.
        Parameters:
        target - the list where to match the chunk
        Throws:
        PatchException - fail to match the chunk
      • getElements

        List<E> getElements()
        Returns:
        the elements in the snippet
      • setElements

        void setElements​(List<E> elements)
        Parameters:
        elements - the elements in the snippet
      • size

        int size()
        Returns:
        the size of the snippet
      • getIndex

        int getIndex()
        Returns:
        the start index of the chunk in the list
      • getLastIndex

        int getLastIndex()
        Returns:
        the index of the last element of the chunk in the list
      • isOverlappingWith

        default boolean isOverlappingWith​(Chunk<E> otherChunk)
        Check if the current chunk is overlapping with another chunk based on the indexes.
        Parameters:
        otherChunk - the other chunk to test.
        Returns:
        true if both chunks shares some indexes.
        Since:
        11.7RC1, 10.11.10, 11.3.3