|
OpenAPI 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AQDifferences
This interface defines a set of lines produced by the comparison operation.
Each line, represented by AQLineChange
instance, can be either an added line, a deleted line,
a modified line, or an unchanged line.
1 2 3 deleted 4
1 modified 2 4 5 added
var comp = aqua.compare.newComparator();
var diff = comp.compare("1\n2\n3 deleted\n4\n","1 Modified\n2\n4\n5 added\n");
var changes = diff.getChanges();
for(var i=0; i < changes.length; i++)
{
print(changes[i]);
}
Output:
MODIFIED[1]->[1 Modified] UNCHANGED[2]==[2] DELETED[3 deleted] UNCHANGED[4]==[4] ADDED[5 added]To visually see what lines have been added/modified/deleted and to better understand the change algorithm and its output, use the toHTML(true) method call and display the result in a browser. Each table row in the HTML output corresponds to a row in AQLineChange[].
Method Summary | |
---|---|
AQLineChange[] |
getChanges()
Returns a non-null array of changes, suitable for formatted output. |
int |
getModificationCount()
Returns a number of ADDED, DELETED, or MODIFIED lines (excluding UNCHANGED). |
AQLineChange[] |
getModificationsOnly()
Returns a non-null array of changes excluding UNCHANGED items. |
boolean |
isDifferent()
Returns true only if changes are present. |
String |
toHtml()
Returns a string which represents a HTML-formatted representation of the changes. |
String |
toHtml(boolean showLegend)
Returns a string which represents a HTML-formatted representation of the changes. |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Method Detail |
---|
int getModificationCount()
boolean isDifferent()
AQLineChange[] getModificationsOnly()
AQLineChange[] getChanges()
String toHtml()
String toHtml(boolean showLegend)
showLegend
- Set to true to display a legend.
|
OpenAPI 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |