本文整理了Java中difflib.Delta.restore()
方法的一些代码示例,展示了Delta.restore()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Delta.restore()
方法的具体详情如下:
包路径:difflib.Delta
类名称:Delta
方法名:restore
[英]Cancel this delta for a given revised text. The action is opposite to patch.
[中]取消给定修订文本的此增量。该动作与patch相反。
代码示例来源:origin: com.googlecode.java-diff-utils/diffutils
/**
* Restore the text to original. Opposite to applyTo() method.
* @param target the given target
* @return the restored text
*/
public List<T> restore(List<T> target) {
List<T> result = new LinkedList<T>(target);
ListIterator<Delta<T>> it = getDeltas().listIterator(deltas.size());
while (it.hasPrevious()) {
Delta<T> delta = (Delta<T>) it.previous();
delta.restore(result);
}
return result;
}
代码示例来源:origin: com.custardsource.dybdob/java-diff-utils-copy
/**
* Restore the text to original. Opposite to applyTo() method.
* @param target the given target
* @return the restored text
*/
public List<?> restore(List<?> target) {
List<Object> result = new LinkedList<Object>(target);
ListIterator<Delta> it = getDeltas().listIterator(deltas.size());
while (it.hasPrevious()) {
Delta delta = (Delta) it.previous();
delta.restore(result);
}
return result;
}
内容来源于网络,如有侵权,请联系作者删除!