Package org.assertj.core.util.diff
Class Chunk<T>
java.lang.Object
org.assertj.core.util.diff.Chunk<T>
- Type Parameters:
T
- The type of the compared elements in the 'lines'.
Copy from https://code.google.com/p/java-diff-utils/.
Holds the information about the part of text involved in the diff process
Text is represented as 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.
- Author:
- Dmitry Naumenko
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Chunk
Creates a chunk and saves a copy of affected lines- Parameters:
position
- the start positionlines
- the affected lines
-
-
Method Details
-
verify
Verifies that this chunk's saved text matches the corresponding text in the given sequence.- Parameters:
target
- the sequence to verify against.- Throws:
IllegalStateException
-
getPosition
public int getPosition()- Returns:
- the start position of chunk in the text
-
getLines
- Returns:
- the affected lines
-
size
public int size()Return the chunk size- Returns:
- the chunk size
-
last
public int last()Returns the index of the last line of the chunk.- Returns:
- the index of the last line of the chunk.
-
hashCode
public int hashCode() -
equals
-
toString
-