Package com.goodow.realtime.operation.cursor

Examples of com.goodow.realtime.operation.cursor.ReferenceShiftedComponent


  @Override public void setIndex(int index) {
    if (index == this.index) {
      return;
    }
    ReferenceShiftedComponent op =
        new ReferenceShiftedComponent(id, referencedObjectId, index, canBeDeleted, this.index);
    consumeAndSubmit(op);
  }
View Full Code Here


  }

  @Override
  protected void consume(final String userId, final String sessionId,
      OperationComponent<?> component) {
    ReferenceShiftedComponent op = (ReferenceShiftedComponent) component;
    assert op.oldIndex == index() || index() == -1;
    referencedObjectId = op.referencedObjectId;
    index = op.newIndex;
    canBeDeleted = op.canBeDeleted;
    if (op.oldIndex != -1 && op.oldIndex != op.newIndex) {
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

    }
  }

  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();
View Full Code Here

          IndexReferenceImpl indexReference = getObject(indexReferenceId);
          int currentIndex = indexReference.index();
          int newIndex = op.transformIndexReference(currentIndex, true,
                                                    indexReference.canBeDeleted());
          if (newIndex != currentIndex) {
            indexReference.consume(userId, sessionId, new ReferenceShiftedComponent(
                indexReferenceId, op.id, newIndex, indexReference.canBeDeleted(), currentIndex));
          }
        }
      });
    }
View Full Code Here

TOP

Related Classes of com.goodow.realtime.operation.cursor.ReferenceShiftedComponent

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.