@Override public void deleteCharacters(int n) { if (a.checkDeleteCharacters(n, v) == ValidationResult.ILL_FORMED) { throw new IllFormed(); } a.doDeleteCharacters(n); }
@Override void resolveUpdateAttributes(AttributesUpdate update) { syncAnnotations(); targetDocument.replaceAttributes(this.oldAttributes.updateWith(update), this.newAttributes); otherTarget.targetDocument.retain(1); }
@Override public boolean build(DocInitializationCursor d, DocOpCursor m) { d.elementStart("blip", Attributes.EMPTY_MAP); d.elementEnd(); m.retain(3); m.retain(1); return false; } });
@Override public void updateAttributes(AttributesUpdate attrUpdate) { flushAnnotations(); normalizer.elementStart(type, attrs.updateWith(attrUpdate)); target = defaultTarget; }
@Override public void deleteElementStart(String type, Attributes attrs) { flushAnnotations(); normalizer.deleteElementStart(type, attrs.updateWith(invertUpdate(attrUpdate))); target = defaultTarget; }
public void testComputeStringCost() { assertEquals(0, f1.computeCost(S0)); assertEquals(1, f1.computeCost(S1A)); assertEquals(1, f1.computeCost(S1B)); assertEquals(2, f1.computeCost(S2)); assertEquals(10, f1.computeCost(S10)); }
@Override public void characters(String s) { if (a.checkCharacters(s, v) == ValidationResult.ILL_FORMED) { throw new IllFormed(); } a.doCharacters(s); }
@Override public void deleteElementEnd() { if (a.checkDeleteElementEnd(v) == ValidationResult.ILL_FORMED) { throw new IllFormed(); } a.doDeleteElementEnd(); }
@Override public void replaceAttributes(Attributes attributes) { if (a.checkSetAttributes(attributes, v) == ValidationResult.ILL_FORMED) { throw new IllFormed(); } a.doSetAttributes(attributes); }
@Override public void updateAttributes(Map<String, String> attributes) { if (a.checkUpdateAttributes(attributes, v) == ValidationResult.ILL_FORMED) { throw new IllFormed(); } a.doUpdateAttributes(attributes); } });
/** * Performs a deleteElementStart transition with the given parameters. */ public void doDeleteElementStart() { assert checkDeleteElementStart(null) != ValidationResult.ILL_FORMED; pushOntoStack(DeleteElement.getInstance()); advance(1); // size decrease happens in delete element end }
/** * Performs an elementStart transition with the given parameters. */ public void doElementStart(String tag, Map<String, String> attr) { assert checkElementStart(tag, attr, null) != ValidationResult.ILL_FORMED; pushOntoStack(InsertElement.getInstance(tag)); increaseLength(2); resultingPos += 1; }
@Override public void apply() { a.doElementStart(tag, attributes); targetDoc.elementStart(tag, attributes); } };
@Override void apply() { a.doElementEnd(); targetDoc.elementEnd(); } }
@Override void apply() { a.doDeleteElementStart(); targetDoc.deleteElementStart(); } }
@Override void apply(Attributes attrs) { a.doUpdateAttributes(attrs); targetDoc.updateAttributes(attrs); } }
@Override void resolveUpdateAttributes(AttributesUpdate update) { targetDocument.replaceAttributes(this.oldAttributes.updateWith(update), this.newAttributes); otherTarget.targetDocument.retain(1); }
public void testComputeStringCost() { assertEquals(0, f1.computeCost(S0)); assertEquals(1, f1.computeCost(S1A)); assertEquals(1, f1.computeCost(S1B)); assertEquals(2, f1.computeCost(S2)); assertEquals(10, f1.computeCost(S10)); }
@Override void resolveReplaceAttributes(Attributes oldAttributes, Attributes newAttributes) { targetDocument.retain(1); otherTarget.targetDocument.replaceAttributes(oldAttributes.updateWith(update), newAttributes); }