Package com.goodow.realtime.operation.create

Examples of com.goodow.realtime.operation.create.CreateComponent


  }

  @Override
  OperationComponent<?>[] toInitialization() {
    OperationComponent<?>[] toRtn = new OperationComponent[1 + (length() == 0 ? 0 : 1)];
    toRtn[0] = new CreateComponent(id, CreateComponent.STRING);
    if (length() != 0) {
      toRtn[1] = new StringInsertComponent(id, 0, getText());
    }
    return toRtn;
  }
View Full Code Here


  @Override
  OperationComponent<?>[] toInitialization() {
    ReferenceShiftedComponent op =
        new ReferenceShiftedComponent(id, referencedObjectId, index, canBeDeleted, index);
    return new OperationComponent[] {new CreateComponent(id, CreateComponent.INDEX_REFERENCE), op};
  }
View Full Code Here

  }

  @Override
  OperationComponent<?>[] toInitialization() {
    final OperationComponent<?>[] toRtn = new OperationComponent[1 + size()];
    toRtn[0] = new CreateComponent(id, CreateComponent.MAP);
    if (!isEmpty()) {
      snapshot.forEach(new MapIterator<JsonArray>() {
        int i = 1;

        @Override
View Full Code Here

  }

  @Override public CollaborativeList createList(JsonArray opt_initialValue) {
    String id = generateObjectId();
    beginCreationCompoundOperation();
    bridge.consumeAndSubmit(new CreateComponent(id, CreateComponent.LIST));
    if (opt_initialValue != null && opt_initialValue.length() > 0) {
      JsonArray values = JsonSerializer.serializeObjects(opt_initialValue);
      JsonInsertComponent op = new JsonInsertComponent(id, 0, values);
      bridge.consumeAndSubmit(op);
    }
View Full Code Here

  @Override
  public CollaborativeMap createMap(JsonObject opt_initialValue) {
    final String id = generateObjectId();
    beginCreationCompoundOperation();
    bridge.consumeAndSubmit(new CreateComponent(id, CreateComponent.MAP));
    if (opt_initialValue != null && opt_initialValue.size() != 0) {
      opt_initialValue.forEach(new JsonObject.MapIterator<Object>() {
        @Override
        public void call(String key, Object value) {
          JsonArray serializedValue = JsonSerializer.serializeObject(value);
View Full Code Here

  }

  @Override public CollaborativeString createString(String opt_initialValue) {
    String id = generateObjectId();
    beginCreationCompoundOperation();
    bridge.consumeAndSubmit(new CreateComponent(id, CreateComponent.STRING));
    if (opt_initialValue != null && !opt_initialValue.isEmpty()) {
      StringInsertComponent op = new StringInsertComponent(id, 0, opt_initialValue);
      bridge.consumeAndSubmit(op);
    }
    endCompoundOperation();
View Full Code Here

  IndexReference createIndexReference(String referencedObjectId, int index, boolean canBeDeleted) {
    String id = generateObjectId();
    ReferenceShiftedComponent op =
        new ReferenceShiftedComponent(id, referencedObjectId, index, canBeDeleted, -1);
    beginCreationCompoundOperation();
    bridge.consumeAndSubmit(new CreateComponent(id, CreateComponent.INDEX_REFERENCE));
    bridge.consumeAndSubmit(op);
    registerIndexReference(id, referencedObjectId);
    endCompoundOperation();
    return getObject(id);
  }
View Full Code Here

    return getObject(id);
  }

  void createRoot() {
    beginCreationCompoundOperation();
    bridge.consumeAndSubmit(new CreateComponent(ROOT_ID, CreateComponent.MAP));
    endCompoundOperation();
  }
View Full Code Here

  @Override
  OperationComponent<?>[] toInitialization() {
    int length = length();
    OperationComponent<?>[] toRtn = new OperationComponent[1 + (length == 0 ? 0 : 1)];
    toRtn[0] = new CreateComponent(id, CreateComponent.LIST);
    if (length != 0) {
      toRtn[1] = new JsonInsertComponent(id, 0, subValues(0, length));
    }
    return toRtn;
  }
View Full Code Here

TOP

Related Classes of com.goodow.realtime.operation.create.CreateComponent

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.