| Modifier and Type | Class and Description |
|---|---|
static class |
StringDelta.StringUpdateBuilder |
| Constructor and Description |
|---|
StringDelta(byte[] data)
Constructs a string diff from the given binary data.
|
StringDelta(DataInput input)
Deserializes a string diff from the given input.
|
| Modifier and Type | Method and Description |
|---|---|
static StringDelta |
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 StringDelta |
diff(java.lang.String original,
java.lang.String modified)
Calculates the difference between two given strings.
|
static StringDelta.StringUpdateBuilder |
getBuilder()
Constructs a new string builder.
|
int |
length() |
static StringDelta |
read(DataInput input)
Reads a string diff from the given input stream.
|
void |
serialize(DataOutput output)
Serializes the diff to the given output stream.
|
StringDelta |
shift(StringDelta 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 StringDelta(byte[] data)
data - encoded diff dtapublic StringDelta(DataInput input) throws java.io.IOException
input - input streamjava.io.IOException - if an I/O error occurspublic static StringDelta create(java.lang.String value)
value - value to create the diff forpublic static StringDelta diff(java.lang.String original, java.lang.String modified)
original - original (old) stringmodified - modified (new) stringpublic static StringDelta 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 StringDelta shift(StringDelta other)
other - updates to be matched topublic void serialize(DataOutput output) throws java.io.IOException
DataDeltapublic int length()
public java.lang.String update(java.lang.String original)
DataDeltapublic static StringDelta.StringUpdateBuilder getBuilder()
public java.lang.String toString()
toString in class java.lang.Object