|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crosswire.common.diff.LineMap
public class LineMap
LineMap is a heuristic algorithm that allows the differencing of a representation of lines. A Diff of the source and target maps can be reconstituted with restore.
The GNU Lesser General Public License for details.| Field Summary | |
|---|---|
private List<String> |
lines
The lines from the original. |
private String |
sourceMap
Each character in sourceMap provides an integer representation of the line in the original. |
private String |
targetMap
Each character in sourceMap provides an integer representation of the line in the original. |
| Constructor Summary | |
|---|---|
LineMap(String source,
String target)
Split two texts into a list of strings. |
|
| Method Summary | |
|---|---|
List<String> |
getLines()
|
String |
getSourceMap()
|
String |
getTargetMap()
|
private String |
linesToCharsMunge(String text,
List<String> linearray,
Map<String,Integer> linehash)
Split a text into a list of strings. |
void |
restore(List<?> diffs)
Rehydrate the text in a diff from a string of line hashes to real lines of text. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private String sourceMap
private String targetMap
private List<String> lines
| Constructor Detail |
|---|
public LineMap(String source,
String target)
source - Baseline stringtarget - Changed string| Method Detail |
|---|
public void restore(List<?> diffs)
diffs - List of Difference objectspublic String getSourceMap()
public String getTargetMap()
public List<String> getLines()
private String linesToCharsMunge(String text,
List<String> linearray,
Map<String,Integer> linehash)
text - String to encodelinearray - List of unique stringslinehash - Map of strings to indices
|
Copyright ยจ 2003-2015 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||