Examples of DocOpCollector


Examples of org.waveprotocol.wave.model.document.operation.algorithm.DocOpCollector

      ci = r.clientOp();
      sd = r.serverOp();
      r = new InsertionDeletionTransformer().transformOperations(si, cd);
      si = r.clientOp();
      cd = r.serverOp();
      DocOpCollector clientCollector = new DocOpCollector();
      DocOpCollector serverCollector = new DocOpCollector();
      clientCollector.add(ci);
      serverCollector.add(si);
      while (!AnnotationTamenessChecker.checkTameness(cp, sp, cd, sd)) {
        r = new PreservationPreservationTransformer().transformOperations(cp, sp);
        cp = r.clientOp();
        sp = r.serverOp();
        Pair<DocOp, Pair<DocOp, DocOp>> rc =
            new PreservationDeletionTransformer().transformOperations(cp, sd);
        Pair<DocOp, Pair<DocOp, DocOp>> rs =
            new PreservationDeletionTransformer().transformOperations(sp, cd);
        clientCollector.add(rc.first);
        serverCollector.add(rs.first);
        sp = rc.second.first;
        sd = rc.second.second;
        cp = rs.second.first;
        cd = rs.second.second;
      }
      r = new DeletionDeletionTransformer().transformOperations(cd, sd);
      cd = r.clientOp();
      sd = r.serverOp();
      clientCollector.add(cd);
      serverCollector.add(sd);
      return new OperationPair<DocOp>(
          clientCollector.composeAll(), serverCollector.composeAll());
    // We're catching runtime exceptions here, but checked exceptions may be better.
    } catch (RuntimeException e) {
      throw new TransformException(e);
    }
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.operation.algorithm.DocOpCollector

   * Composes all the operations together and returns the result.
   *
   * @return The composition of all the operations in the list.
   */
  DocOp composeAll() {
    DocOpCollector collector = new DocOpCollector();
    collectInto(collector);
    return collector.composeAll();
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.operation.algorithm.DocOpCollector

  }

  @Override
  public void consumeAsDiff(DocOp op) {
    if (diff == null) {
      diff = new DocOpCollector();
    }
    diff.add(op);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.operation.algorithm.DocOpCollector

    private final DocOpCollector diff;

    DocDiff(long lastReadVersion) {
      Preconditions.checkArgument(lastReadVersion >= 0, "lastReadVersion = %s", lastReadVersion);
      this.lastReadVersion = lastReadVersion;
      this.state = new DocOpCollector();
      this.diff = new DocOpCollector();
    }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.operation.algorithm.DocOpCollector

  }

  @Override
  public void consumeAsDiff(DocOp op) {
    if (diff == null) {
      diff = new DocOpCollector();
    }
    diff.add(op);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.operation.algorithm.DocOpCollector

   * Composes all the operations together and returns the result.
   *
   * @return The composition of all the operations in the list.
   */
  DocOp composeAll() {
    DocOpCollector collector = new DocOpCollector();
    collectInto(collector);
    return collector.composeAll();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.