Package com.goodow.realtime.operation.list.string

Examples of com.goodow.realtime.operation.list.string.StringInsertComponent


    if (text == null || text.isEmpty()) {
      throw new IllegalArgumentException(
          "At least one value must be specified for an insert mutation. text: " + text);
    }
    checkIndex(index);
    StringInsertComponent op = new StringInsertComponent(id, index, text);
    consumeAndSubmit(op);
  }
View Full Code Here


  @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 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();
    return getObject(id);
  }
View Full Code Here

TOP

Related Classes of com.goodow.realtime.operation.list.string.StringInsertComponent

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.