|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectdifflib.Chunk
public class Chunk
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.
| Constructor Summary | |
|---|---|
Chunk(int position,
int size,
java.util.List<?> lines)
Creates a chunk and saves a copy of affected lines |
|
Chunk(int position,
int size,
java.lang.Object[] lines)
Creates a chunk and saves a copy of affected lines |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
|
java.util.List<?> |
getLines()
|
int |
getPosition()
|
int |
getSize()
|
int |
hashCode()
|
int |
last()
Returns the index of the last line of the chunk. |
void |
setLines(java.util.List<?> lines)
|
void |
setPosition(int position)
|
void |
setSize(int size)
|
java.lang.String |
toString()
|
void |
verify(java.util.List<?> target)
Verifies that this chunk's saved text matches the corresponding text in the given sequence. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Chunk(int position,
int size,
java.util.List<?> lines)
position - the start positionsize - the size of a Chunklines - the affected lines
public Chunk(int position,
int size,
java.lang.Object[] lines)
position - the start positionsize - the size of a Chunklines - the affected lines| Method Detail |
|---|
public void verify(java.util.List<?> target)
throws PatchFailedException
target - the sequence to verify against.
PatchFailedExceptionpublic int getPosition()
public void setPosition(int position)
position - the start position to setpublic int getSize()
public void setSize(int size)
size - the size of affected lines to setpublic java.util.List<?> getLines()
public void setLines(java.util.List<?> lines)
lines - the affected lines to setpublic 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
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||