当前位置: 首页>>代码示例>>Java>>正文


Java WaveletBlipOperation.getBlipId方法代码示例

本文整理汇总了Java中org.waveprotocol.wave.model.operation.wave.WaveletBlipOperation.getBlipId方法的典型用法代码示例。如果您正苦于以下问题:Java WaveletBlipOperation.getBlipId方法的具体用法?Java WaveletBlipOperation.getBlipId怎么用?Java WaveletBlipOperation.getBlipId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.waveprotocol.wave.model.operation.wave.WaveletBlipOperation的用法示例。


在下文中一共展示了WaveletBlipOperation.getBlipId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: attachDocHandler

import org.waveprotocol.wave.model.operation.wave.WaveletBlipOperation; //导入方法依赖的package包/类
/**
 * Attaches a doc handler to the blip the operation applies to.
 *
 * @param conversation the conversation the op is to be applied to.
 * @param op the op to be applied
 * @param docHandlers the list of attached dochandlers.
 * @param capabilities the capabilities of the robot.
 * @param messages the bundle to put the generated events in.
 * @param deltaAuthor the author of the events generated.
 * @param timestamp the timestamp at which these events occurred.
 */
private void attachDocHandler(ObservableConversation conversation, WaveletOperation op,
    Map<String, EventGeneratingDocumentHandler> docHandlers,
    Map<EventType, Capability> capabilities, EventMessageBundle messages,
    ParticipantId deltaAuthor, long timestamp) {
  WaveletBlipOperation blipOp = (WaveletBlipOperation) op;
  String blipId = blipOp.getBlipId();
  // Ignoring the documents outside the conversation such as tags
  // and robot data docs.
  ObservableConversationBlip blip = conversation.getBlip(blipId);
  if (blip != null) {
    String blipId1 = blip.getId();

    EventGeneratingDocumentHandler docHandler = docHandlers.get(blipId1);
    if (docHandler == null) {
      ObservableDocument doc = (ObservableDocument) blip.getDocument();
      docHandler = new EventGeneratingDocumentHandler(
          doc, blip, capabilities, messages, deltaAuthor, timestamp);
      doc.addListener(docHandler);
      docHandlers.put(blipId1, docHandler);
    } else {
      docHandler.setAuthorAndTimeStamp(deltaAuthor, timestamp);
    }
  }
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:36,代码来源:EventGenerator.java

示例2: attachDocHandler

import org.waveprotocol.wave.model.operation.wave.WaveletBlipOperation; //导入方法依赖的package包/类
/**
 * Attaches a doc handler to the blip the operation applies to.
 *
 * @param conversation the conversation the op is to be applied to.
 * @param op the op to be applied
 * @param docHandlers the list of attached dochandlers.
 * @param capabilities the capabilities of the robot.
 * @param messages the bundle to put the generated events in.
 * @param deltaAuthor the author of the events generated.
 * @param timestamp the timestamp at which these events occurred.
 */
private void attachDocHandler(ObservableConversation conversation, WaveletOperation op,
    Map<String, EventGeneratingDocumentHandler> docHandlers,
    Map<EventType, Capability> capabilities, EventMessageBundle messages,
    ParticipantId deltaAuthor, long timestamp, Wavelet wavelet, EventDataConverter converter) {
  WaveletBlipOperation blipOp = (WaveletBlipOperation) op;
  String blipId = blipOp.getBlipId();
  // Ignoring the documents outside the conversation such as tags
  // and robot data docs.
  ObservableConversationBlip blip = conversation.getBlip(blipId);
  if (blip != null) {
    String blipId1 = blip.getId();

    EventGeneratingDocumentHandler docHandler = docHandlers.get(blipId1);
    if (docHandler == null) {
      ObservableDocument doc = (ObservableDocument) blip.getContent();
      docHandler =
          new EventGeneratingDocumentHandler(doc, blip, capabilities, messages, deltaAuthor,
              timestamp, wavelet, converter);
      doc.addListener(docHandler);
      docHandlers.put(blipId1, docHandler);
    } else {
      docHandler.setAuthorAndTimeStamp(deltaAuthor, timestamp);
    }
  }
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:37,代码来源:EventGenerator.java

示例3: makeSegmentOperations

import org.waveprotocol.wave.model.operation.wave.WaveletBlipOperation; //导入方法依赖的package包/类
@Timed
static Map<SegmentId, SegmentOperation> makeSegmentOperations(WaveletDeltaRecord delta) {
  LoadingCache<SegmentId, ImmutableList.Builder<WaveletOperation>> builders = CacheBuilder.newBuilder().build(
    new CacheLoader<SegmentId, ImmutableList.Builder<WaveletOperation>>(){

    @Override
    public ImmutableList.Builder<WaveletOperation> load(SegmentId segmentId) {
      return ImmutableList.builder();
    }
  });
  Map<SegmentId, SegmentOperation> segmentOperations = CollectionUtils.newHashMap();
  for (WaveletOperation op : delta.getTransformedDelta()) {
    WaveletOperationContext newContext = makeSegmentContext(op.getContext(), delta.getResultingVersion().getVersion());
    if (op instanceof AddParticipant) {
      builders.getUnchecked(SegmentId.PARTICIPANTS_ID).add(
        new AddParticipant(newContext, ((AddParticipant)op).getParticipantId()));
    } else if (op instanceof RemoveParticipant) {
      builders.getUnchecked(SegmentId.PARTICIPANTS_ID).add(
        new RemoveParticipant(newContext, ((RemoveParticipant)op).getParticipantId()));
    } else if (op instanceof NoOp) {
      builders.getUnchecked(SegmentId.PARTICIPANTS_ID).add(new NoOp(newContext));
    } else {
      WaveletBlipOperation blipOp = (WaveletBlipOperation)op;
      BlipContentOperation blipContentOp = (BlipContentOperation)blipOp.getBlipOp();
      BlipContentOperation newBlipContentOp = new BlipContentOperation(newContext,
        blipContentOp.getContentOp(), blipContentOp.getContributorMethod());
      WaveletBlipOperation newBlipOp = new WaveletBlipOperation(blipOp.getBlipId(), newBlipContentOp);
      builders.getUnchecked(SegmentId.ofBlipId(blipOp.getBlipId())).add(newBlipOp);
    }
  }
  for (Entry<SegmentId, ImmutableList.Builder<WaveletOperation>> entry : builders.asMap().entrySet()) {
    segmentOperations.put(entry.getKey(), new SegmentOperationImpl(entry.getValue().build()));
  }
  return segmentOperations;
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:36,代码来源:SegmentWaveletStateImpl.java

示例4: optimise

import org.waveprotocol.wave.model.operation.wave.WaveletBlipOperation; //导入方法依赖的package包/类
public void optimise() {
  int startSize = size();
  if (startSize == 1) {
    return;
  }

  ArrayList<DocOp> docOps = CollectionUtils.newArrayList();
  List<WaveletOperation> oldOperations = CollectionUtils.newArrayList(this);
  String currentId = null;
  WaveletOperationContext lastOperationContext = null;
  this.clear();

  for (WaveletOperation waveletOp : oldOperations) {
    if (waveletOp instanceof WaveletBlipOperation) {
      WaveletBlipOperation waveletBlipOp = ((WaveletBlipOperation) waveletOp);
      String id = waveletBlipOp.getBlipId();
      BlipOperation blipOp = waveletBlipOp.getBlipOp();
      if (blipOp instanceof BlipContentOperation) {
        if (!docOps.isEmpty() && !id.equals(currentId)) {
          composeDocOps(this, currentId, lastOperationContext, docOps);
        }
        docOps.add(((BlipContentOperation) blipOp).getContentOp());
        lastOperationContext = blipOp.getContext();
        currentId = id;
        continue;
      }
    }
    if (!docOps.isEmpty()) {
      composeDocOps(this, currentId, lastOperationContext, docOps);
    }
    add(waveletOp);
  }
  if (!docOps.isEmpty()) {
    composeDocOps(this, currentId, lastOperationContext, docOps);
  }
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:37,代码来源:MergingSequence.java

示例5: visitWaveletBlipOperation

import org.waveprotocol.wave.model.operation.wave.WaveletBlipOperation; //导入方法依赖的package包/类
@Override
public void visitWaveletBlipOperation(WaveletBlipOperation op) {
  blipId = op.getBlipId();
  op.getBlipOp().acceptVisitor(this);
  blipId = null;
}
 
开发者ID:ArloJamesBarnes,项目名称:walkaround,代码行数:7,代码来源:OperationSerializer.java

示例6: visitWaveletBlipOperation

import org.waveprotocol.wave.model.operation.wave.WaveletBlipOperation; //导入方法依赖的package包/类
@Override
public void visitWaveletBlipOperation(WaveletBlipOperation op) {
  inverse = new WaveletBlipOperation(
      op.getBlipId(), BlipOperationInverter.invert(reverseContext, op.getBlipOp()));
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:6,代码来源:WaveletOperationInverter.java


注:本文中的org.waveprotocol.wave.model.operation.wave.WaveletBlipOperation.getBlipId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。