T - The type of the compared elements in the 'lines'.public class Chunk<T>
extends java.lang.Object
Object[] because the diff engine is
capable of handling more than plain ascci. In fact, arrays or lists of any
type that implements hashCode() and
equals() correctly can be subject to
differencing using this library.| Constructor and Description |
|---|
Chunk(int position,
java.util.List<T> lines)
Creates a chunk and saves a copy of affected lines
|
Chunk(int position,
T[] lines)
Creates a chunk and saves a copy of affected lines
|
| Modifier and Type | Method and Description |
|---|---|
int |
applyHunk(java.util.List<T> target) |
int |
applyHunk(java.util.List<T> target,
int lastOffset) |
int |
applyHunk(java.util.List<T> target,
int lastOffset,
Equalizer<T> equalizer) |
Chunk<T> |
copy() |
boolean |
equals(java.lang.Object obj) |
java.util.List<T> |
getLines() |
int |
getPosition() |
int |
hashCode() |
int |
last() |
void |
setLines(java.util.List<T> lines) |
int |
size() |
java.lang.String |
toString() |
void |
verify(java.util.List<T> target)
Verifies that this chunk's saved text matches the corresponding text in
the given sequence.
|
public Chunk(int position,
java.util.List<T> lines)
position - the start positionlines - the affected linespublic Chunk(int position,
T[] lines)
position - the start positionlines - the affected linespublic void verify(java.util.List<T> target) throws PatchFailedException
target - the sequence to verify against.PatchFailedException - if the patch cannot be applied.public int applyHunk(java.util.List<T> target) throws DiffException
DiffExceptionpublic int applyHunk(java.util.List<T> target, int lastOffset) throws DiffException
DiffExceptionpublic int applyHunk(java.util.List<T> target, int lastOffset, Equalizer<T> equalizer) throws DiffException
DiffExceptionpublic int getPosition()
public void setLines(java.util.List<T> lines)
public java.util.List<T> getLines()
public int size()
public int last()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object