Package org.xwiki.diff
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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<E>
getElements()
int
getIndex()
int
getLastIndex()
default boolean
isOverlappingWith(Chunk<E> otherChunk)
Check if the current chunk is overlapping with another chunk based on the indexes.void
setElements(List<E> elements)
int
size()
void
verify(List<E> target)
Verify that the chunk can be found in the provided list.
-
-
-
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
-
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
-
-