| Modifier and Type | Class and Description |
|---|---|
static class |
StringDiff.StringUpdateBuilder |
| Constructor and Description |
|---|
StringDiff(byte[] data)
Constructs a string diff from the given binary data.
|
StringDiff(DataInput input)
Deserializes a string diff from the given input.
|
| Modifier and Type | Method and Description |
|---|---|
static StringDiff |
create(java.lang.String value)
Constructs a string diff which will always expand into the given string.
|
<T,R> R |
decode(StringUpdater<T,R> update)
Performs a decode operation.
|
static StringDiff |
diff(java.lang.String original,
java.lang.String modified)
Calculates the difference between two given strings.
|
static StringDiff.StringUpdateBuilder |
getBuilder()
Constructs a new string builder.
|
int |
length() |
static StringDiff |
read(DataInput input)
Reads a string diff from the given input stream.
|
void |
serialize(DataOutput output)
Serializes the diff to the given output stream.
|
StringDiff |
shift(StringDiff other)
Shifts the string updates to match the updates of another string update.
|
java.lang.String |
toString() |
java.lang.String |
update(java.lang.String original)
Updates the given value.
|
public StringDiff(byte[] data)
data - encoded diff dtapublic StringDiff(DataInput input) throws java.io.IOException
input - input streamjava.io.IOException - if an I/O error occurspublic static StringDiff create(java.lang.String value)
value - value to create the diff forpublic static StringDiff diff(java.lang.String original, java.lang.String modified)
original - original (old) stringmodified - modified (new) stringpublic static StringDiff read(DataInput input) throws java.io.IOException
input - input stream to read fromjava.io.IOException - if an I/O error occurspublic <T,R> R decode(StringUpdater<T,R> update)
T - intermediate result typeR - result typeupdate - update callbackpublic StringDiff shift(StringDiff other)
other - updates to be matched topublic void serialize(DataOutput output) throws java.io.IOException
DataDiffpublic int length()
public java.lang.String update(java.lang.String original)
DataDiffpublic static StringDiff.StringUpdateBuilder getBuilder()
public java.lang.String toString()
toString in class java.lang.Object