/** * Creates a delta object with the given chunks from the original and revised texts. * * @param orig * @param rev */ protected Delta(Chunk orig, Chunk rev) { init(orig, rev); }
/** * Creates a delta object with the given chunks from the original and revised texts. * * @param orig * @param rev */ protected Delta(final Chunk orig, final Chunk rev) { init(orig, rev); }
/** * Creates a delta object with the given chunks from the original and revised texts. * * @param orig * @param rev */ protected Delta(Chunk orig, Chunk rev) { init(orig, rev); }
/** * Returns a Delta that corresponds to the given chunks in the original and revised text * respectively. * * @param orig * the chunk in the original text. * @param rev * the chunk in the revised text. * @return Delta */ public static Delta newDelta(final Chunk orig, final Chunk rev) { Class<?> c = DeltaClass[orig.size() > 0 ? 1 : 0][rev.size() > 0 ? 1 : 0]; Delta result; try { result = (Delta)c.newInstance(); } catch (Exception e) { return null; } result.init(orig, rev); return result; }
/** * Returns a Delta that corresponds to the given chunks in the original and revised text * respectively. * * @param orig * the chunk in the original text. * @param rev * the chunk in the revised text. * @return Delta */ public static Delta newDelta(Chunk orig, Chunk rev) { Class c = DeltaClass[orig.size() > 0 ? 1 : 0][rev.size() > 0 ? 1 : 0]; Delta result; try { result = (Delta)c.newInstance(); } catch (Throwable e) { return null; } result.init(orig, rev); return result; }
/** * Returns a Delta that corresponds to the given chunks in the original and revised text * respectively. * * @param orig * the chunk in the original text. * @param rev * the chunk in the revised text. * @return Delta */ public static Delta newDelta(Chunk orig, Chunk rev) { Class<?> c = DeltaClass[orig.size() > 0 ? 1 : 0][rev.size() > 0 ? 1 : 0]; Delta result; try { result = (Delta)c.newInstance(); } catch (Throwable e) { return null; } result.init(orig, rev); return result; }