Package org.waveprotocol.wave.model.document.operation.impl

Examples of org.waveprotocol.wave.model.document.operation.impl.UncheckedDocOpBuffer


    doc.deleteNode(canonical);
  }

  /** Creates an op that restores the doc's current state. */
  private DocOp createRestoreOp() {
    UncheckedDocOpBuffer builder = new UncheckedDocOpBuffer();
    doc.toInitialization().apply(builder);
    return builder.finish();
  }
View Full Code Here


    return builder.finish();
  }

  /** Creates an op that deletes the doc's current state. */
  private DocOp createErasureOp() {
    UncheckedDocOpBuffer builder = new UncheckedDocOpBuffer();
    doc.toInitialization().apply(builder);
    return DocOpInverter.invert(builder.finish());
  }
View Full Code Here

    doc.emptyElement(doc.getDocumentElement());
  }

  private void restore(Document doc) {
    // No comment.
    UncheckedDocOpBuffer builder = new UncheckedDocOpBuffer();
    doc.toInitialization().apply(builder);
    DocOp state = builder.finish();
    DocOp erasure = DocOpInverter.invert(state);
    DocOp restoration;
    try {
      restoration = Composer.compose(erasure, state);
    } catch (OperationException e) {
View Full Code Here

    return domOp;
  }

  private DocOp serializeAnnotations() {
    final AnnotationsNormalizer<DocOp> b =
        new AnnotationsNormalizer<DocOp>(new UncheckedDocOpBuffer());

    AnnotationInterval<Object> last = null;
    for (AnnotationInterval<Object> i : annotations.annotationIntervals(0, size(), knownKeys())) {
      i.diffFromLeft().each(new ProcV<Object>() {
        @Override
View Full Code Here

    boolean didSomethingOtherThanDeletionSinceAnnotationBoundary = false;

    private void begin2() {
      beginChange();
      builder = new AnnotationsNormalizer<DocOp>(
          performValidation ? new DocOpBuffer() : new UncheckedDocOpBuffer());
      sizeDiffSoFar = 0;
      deletionValues.clear();
    }
View Full Code Here

   * @throws OperationException if applying op1 followed by op2 would be invalid
   */
  public static DocOp composeUnchecked(DocOp op1, DocOp op2)
      throws OperationException {
    try {
      return new Composer(new UncheckedDocOpBuffer()).composeOperations(op1, op2);
    } catch (ComposeException e) {
      throw new OperationException(e.getMessage());
    }
  }
View Full Code Here

    int remainder = doc.size() - removeSize - addPosition; // remainder after the insert

    // step 1: initialise the operations for the DOM and annotations:
    DocOpBuffer domOp = new DocOpBuffer();
    final AnnotationsNormalizer<DocOp> annotOp =
      new AnnotationsNormalizer<DocOp>(new UncheckedDocOpBuffer());
    if (addPosition > 0) {
      annotOp.retain(addPosition);
      domOp.retain(addPosition);
    }
View Full Code Here

    return domOp;
  }

  private DocOp serializeAnnotations() {
    final AnnotationsNormalizer<DocOp> b =
        new AnnotationsNormalizer<DocOp>(new UncheckedDocOpBuffer());

    AnnotationInterval<Object> last = null;
    for (AnnotationInterval<Object> i : annotations.annotationIntervals(0, size(), knownKeys())) {
      i.diffFromLeft().each(new ProcV<Object>() {
        @Override
View Full Code Here

    boolean didSomethingOtherThanDeletionSinceAnnotationBoundary = false;

    private void begin2() {
      beginChange();
      builder = new AnnotationsNormalizer<DocOp>(
          performValidation ? new DocOpBuffer() : new UncheckedDocOpBuffer());
      sizeDiffSoFar = 0;
      deletionValues.clear();
    }
View Full Code Here

   * @throws OperationException if applying op1 followed by op2 would be invalid
   */
  public static DocOp composeUnchecked(DocOp op1, DocOp op2)
      throws OperationException {
    try {
      return new Composer(new UncheckedDocOpBuffer()).composeOperations(op1, op2);
    } catch (ComposeException e) {
      throw new OperationException(e.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.document.operation.impl.UncheckedDocOpBuffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.