Examples of AnnotationBoundary


Examples of com.google.walkaround.proto.ProtocolDocumentOperation.Component.AnnotationBoundary

      }

      @Override
      public void annotationBoundary(AnnotationBoundaryMap map) {
        Component component = MessageFactoryHelper.createDocumentOperationComponent();
        AnnotationBoundary boundary =
            MessageFactoryHelper.createDocumentAnnotationBoundary();
        int endSize = map.endSize();
        int changeSize = map.changeSize();
        if (endSize == 0 && changeSize == 0) {
          boundary.setEmpty(true);
        } else {
          for (int i = 0; i < endSize; i++) {
            boundary.addEnd(map.getEndKey(i));
          }
          for (int i = 0; i < changeSize; i++) {
            boundary.addChange(createKeyValueUpdate(map.getChangeKey(i),
                map.getOldValue(i), map.getNewValue(i)));
          }
        }
        component.setAnnotationBoundary(boundary);
        mutation.addComponent(component);
View Full Code Here

Examples of org.waveprotocol.wave.federation.ProtocolDocumentOperation.Component.AnnotationBoundary

  public static DocOp deserialize(ProtocolDocumentOperation op) {
    DocOpBuilder output = new DocOpBuilder();

    for (ProtocolDocumentOperation.Component c : op.getComponent()) {
      if (c.hasAnnotationBoundary()) {
        AnnotationBoundary boundary = c.getAnnotationBoundary();
        if (boundary.getEmpty()) {
          output.annotationBoundary(AnnotationBoundaryMapImpl.EMPTY_MAP);
        } else {
          String[] ends = boundary.getEnd().toArray(new String[boundary.getEnd().size()]);
          int changes = boundary.getChange().size();
          String[] changeKeys = new String[changes];
          String[] oldValues = new String[changes];
          String[] newValues = new String[changes];
          for (int i = 0; i < changes; i++) {
            KeyValueUpdate kvu = boundary.getChange(i);
            changeKeys[i] = kvu.getKey();
            oldValues[i] = kvu.hasOldValue() ? kvu.getOldValue() : null;
            newValues[i] = kvu.hasNewValue() ? kvu.getNewValue() : null;
          }
          output.annotationBoundary(new AnnotationBoundaryMapImpl(ends, changeKeys, oldValues,
View Full Code Here

Examples of org.waveprotocol.wave.federation.ProtocolDocumentOperation.Component.AnnotationBoundary

        addComponent().setUpdateAttributes(u);
      }

      @Override
      public void annotationBoundary(AnnotationBoundaryMap map) {
        AnnotationBoundary a = AnnotationBoundaryJsoImpl.create();
        if (map.endSize() == 0 && map.changeSize() == 0) {
          a.setEmpty(true);
        } else {
          for (int i = 0; i < map.endSize(); i++) {
            a.addEnd(map.getEndKey(i));
          }
          for (int i = 0; i < map.changeSize(); i++) {
            a.addChange(
                keyValueUpdate(map.getChangeKey(i), map.getOldValue(i), map.getNewValue(i)));
          }
        }
        addComponent().setAnnotationBoundary(a);
      }
View Full Code Here

Examples of org.waveprotocol.wave.federation.ProtocolDocumentOperation.Component.AnnotationBoundary

        return this;
      }

      /** Builds a {@link AnnotationBoundary} using this builder and a factory. */
      public AnnotationBoundary build(Factory factory) {
        AnnotationBoundary message = factory.create();
        message.setEmpty(empty);
        message.clearEnd();
        message.addAllEnd(end);
        message.clearChange();
        message.addAllChange(change);
        return message;
      }
View Full Code Here

Examples of org.waveprotocol.wave.federation.ProtocolDocumentOperation.Component.AnnotationBoundary

  public static DocOp deserialize(ProtocolDocumentOperation op) {
    DocOpBuilder output = new DocOpBuilder();

    for (ProtocolDocumentOperation.Component c : op.getComponent()) {
      if (c.hasAnnotationBoundary()) {
        AnnotationBoundary boundary = c.getAnnotationBoundary();
        if (boundary.getEmpty()) {
          output.annotationBoundary(AnnotationBoundaryMapImpl.EMPTY_MAP);
        } else {
          String[] ends = boundary.getEnd().toArray(new String[boundary.getEnd().size()]);
          int changes = boundary.getChange().size();
          String[] changeKeys = new String[changes];
          String[] oldValues = new String[changes];
          String[] newValues = new String[changes];
          for (int i = 0; i < changes; i++) {
            KeyValueUpdate kvu = boundary.getChange(i);
            changeKeys[i] = kvu.getKey();
            oldValues[i] = kvu.hasOldValue() ? kvu.getOldValue() : null;
            newValues[i] = kvu.hasNewValue() ? kvu.getNewValue() : null;
          }
          output.annotationBoundary(new AnnotationBoundaryMapImpl(ends, changeKeys, oldValues,
View Full Code Here

Examples of org.waveprotocol.wave.federation.ProtocolDocumentOperation.Component.AnnotationBoundary

        addComponent().setUpdateAttributes(u);
      }

      @Override
      public void annotationBoundary(AnnotationBoundaryMap map) {
        AnnotationBoundary a = AnnotationBoundaryJsoImpl.create();
        if (map.endSize() == 0 && map.changeSize() == 0) {
          a.setEmpty(true);
        } else {
          for (int i = 0; i < map.endSize(); i++) {
            a.addEnd(map.getEndKey(i));
          }
          for (int i = 0; i < map.changeSize(); i++) {
            a.addChange(
                keyValueUpdate(map.getChangeKey(i), map.getOldValue(i), map.getNewValue(i)));
          }
        }
        addComponent().setAnnotationBoundary(a);
      }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.operation.impl.OperationComponents.AnnotationBoundary

    return BufferedDocOpImpl.createUnchecked(accu.toArray(EMPTY_ARRAY));
  }

  @Override
  public final void annotationBoundary(AnnotationBoundaryMap map) {
    accu.add(new AnnotationBoundary(map));
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.operation.impl.OperationComponents.AnnotationBoundary

    // TODO: This should not need a call to asInitialization().
    return DocOpUtil.asInitialization(BufferedDocOpImpl.createUnchecked(accu.toArray(EMPTY_ARRAY)));
  }

  public final DocInitializationBuilder annotationBoundary(AnnotationBoundaryMap map) {
    accu.add(new AnnotationBoundary(map));
    return this;
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.operation.impl.OperationComponents.AnnotationBoundary

    // TODO: This should not need a call to asInitialization().
    return BufferedDocOpImpl.createUnchecked(accu.toArray(EMPTY_ARRAY));
  }

  public final DocOpBuilder annotationBoundary(AnnotationBoundaryMap map) {
    accu.add(new AnnotationBoundary(map));
    return this;
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.document.operation.impl.OperationComponents.AnnotationBoundary

    return DocOpUtil.asInitialization(BufferedDocOpImpl.createUnchecked(accu.toArray(EMPTY_ARRAY)));
  }

  @Override
  public final void annotationBoundary(AnnotationBoundaryMap map) {
    accu.add(new AnnotationBoundary(map));
  }
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.