|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.gwt.wysiwyg.client.diff.ToString
org.xwiki.gwt.wysiwyg.client.diff.Chunk
public class Chunk
Holds a information about a parrt of the text involved in a differencing or patching operation.
Diff,
Delta| Field Summary | |
|---|---|
protected int |
anchor
|
protected java.util.List |
chunk
|
protected int |
count
|
| Constructor Summary | |
|---|---|
Chunk()
|
|
Chunk(int pos,
int count)
Creates a chunk that doesn't copy the original text. |
|
Chunk(java.util.List iseq,
int pos,
int count)
Creates a chunk and saves a copy the original chunk's text. |
|
Chunk(java.util.List iseq,
int pos,
int count,
int offset)
Creates a chunk that will be displaced in the resulting text, and saves a copy the original chunk's text. |
|
Chunk(java.lang.Object[] iseq,
int pos,
int count)
Creates a chunk and saves a copy the original chunk's text. |
|
Chunk(java.lang.Object[] iseq,
int pos,
int count,
int offset)
Creates a chunk that will be displaced in the resulting text, and saves a copy the original chunk's text. |
|
| Method Summary | |
|---|---|
int |
anchor()
Returns the anchor position of the chunk. |
void |
applyAdd(int start,
java.util.List target)
Add the text of this chunk to the target at the given position. |
void |
applyDelete(java.util.List target)
Delete this chunk from he given text. |
java.util.List |
chunk()
Returns the text saved for this chunk. |
int |
first()
Returns the index of the first line of the chunk. |
int |
last()
Returns the index of the last line of the chunk. |
void |
moveAnchor(int deltaPosition)
|
java.lang.String |
rangeString()
Provide a string representation of the numeric range of this chunk. |
void |
rangeString(java.lang.StringBuffer s)
Provide a string representation of the numeric range of this chunk. |
void |
rangeString(java.lang.StringBuffer s,
java.lang.String separ)
Provide a string representation of the numeric range of this chunk. |
int |
rcsfrom()
Returns the from index of the chunk in RCS terms. |
int |
rcsto()
Returns the to index of the chunk in RCS terms. |
int |
size()
Returns the size of the chunk. |
static java.util.List |
slice(java.util.List seq,
int pos,
int count)
Retreives the specified part from a List. |
static java.util.List |
slice(java.lang.Object[] seq,
int pos,
int count)
Retrieves a slice from an Object array. |
void |
toString(java.lang.StringBuffer s)
Provide a string image of the chunk using the an empty prefix and postfix. |
java.lang.StringBuffer |
toString(java.lang.StringBuffer s,
java.lang.String prefix,
java.lang.String postfix)
Provide a string image of the chunk using the given prefix and postfix. |
boolean |
verify(java.util.List target)
Verifies that this chunk's saved text matches the corresponding text in the given sequence. |
| Methods inherited from class org.xwiki.gwt.wysiwyg.client.diff.ToString |
|---|
arrayToString, stringToArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int anchor
protected int count
protected java.util.List chunk
| Constructor Detail |
|---|
public Chunk()
public Chunk(int pos,
int count)
pos - the start position in the text.count - the size of the chunk.
public Chunk(java.lang.Object[] iseq,
int pos,
int count)
iseq - the original text.pos - the start position in the text.count - the size of the chunk.
public Chunk(java.lang.Object[] iseq,
int pos,
int count,
int offset)
iseq - the original text.pos - the start position in the text.count - the size of the chunk.offset - the position the chunk should have in the resulting text.
public Chunk(java.util.List iseq,
int pos,
int count)
iseq - the original text.pos - the start position in the text.count - the size of the chunk.
public Chunk(java.util.List iseq,
int pos,
int count,
int offset)
iseq - the original text.pos - the start position in the text.count - the size of the chunk.offset - the position the chunk should have in the resulting text.| Method Detail |
|---|
public int anchor()
public void moveAnchor(int deltaPosition)
public int size()
public int first()
public int last()
public int rcsfrom()
public int rcsto()
public java.util.List chunk()
public boolean verify(java.util.List target)
target - the sequence to verify against.
public void applyDelete(java.util.List target)
target - the text to delete from.
public void applyAdd(int start,
java.util.List target)
start - where to add the text.target - the text to add to.public void toString(java.lang.StringBuffer s)
toString in class ToStrings - the string buffer.
public java.lang.StringBuffer toString(java.lang.StringBuffer s,
java.lang.String prefix,
java.lang.String postfix)
s - where the string image should be appended.prefix - the text thatshould prefix each line.postfix - the text that should end each line.
public static java.util.List slice(java.util.List seq,
int pos,
int count)
List.
seq - the list to retreive a slice from.pos - the start position.count - the number of items in the slice.
List containing the specified items.
public static java.util.List slice(java.lang.Object[] seq,
int pos,
int count)
Object array.
seq - the list to retreive a slice from.pos - the start position.count - the number of items in the slice.
List containing the specified items.public java.lang.String rangeString()
public void rangeString(java.lang.StringBuffer s)
s - where the string representation should be appended.
public void rangeString(java.lang.StringBuffer s,
java.lang.String separ)
s - where the string representation should be appended.separ - what to use as line separator.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||