net.sf.okapi.common.Event.isMultiEvent()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中net.sf.okapi.common.Event.isMultiEvent()方法的一些代码示例,展示了Event.isMultiEvent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.isMultiEvent()方法的具体详情如下:
包路径:net.sf.okapi.common.Event
类名称:Event
方法名:isMultiEvent

Event.isMultiEvent介绍

[英]Convenience method to tell if this Event is a MULTI_EVENT
[中]判断此事件是否为多事件的简便方法

代码示例

代码示例来源:origin: net.sf.okapi/okapi-core

/**
 * Convenience method returns the {@link IResource} as a {@link MultiEvent}. The
 * caller should confirm the {@link EventType} using isMultiEvent before calling
 * this method.
 * 
 * @return the {@link MultiEvent}
 * 
 * @throws OkapiUnexpectedResourceTypeException
 *             if the {@link IResource} is not a {@link MultiEvent}
 */
public MultiEvent getMultiEvent() {
  if ( isMultiEvent() ) {
    return (MultiEvent) resource;
  }
  throw new OkapiUnexpectedResourceTypeException("Event resource is not a MultiEvent");
}

代码示例来源:origin: net.sf.okapi/okapi-core

@Override
public List<Event> convertToList(Event event) {
  List<Event> list = new LinkedList<Event>();
  Event me = convert(event);
  if (me.isMultiEvent()) {
    for (Event e : me.getMultiEvent()) {
      if (e.isNoop()) continue;
      list.add(e);
    }
  } else {
    list.add(me);
  }
  
  return list;
}

代码示例来源:origin: net.sf.okapi/okapi-core

private Event processEvent(Event event) {
  if (!isCollectingEvents || isReferentGroup)
    return convertEvent(event);
  
  Event ev = convertEvent(event); // Subclass invocation
  if (ev.isMultiEvent()) {
    for (Event e : ev.getMultiEvent()) {
      if (e.isNoop()) continue;
      group.addEvent(e);
    }
  } else {
    group.addEvent(ev);
  }

  return ev;
}

代码示例来源:origin: net.sf.okapi.lib/okapi-lib-preprocessing

if (e.isMultiEvent()) {
  MultiEvent me = e.getMultiEvent();
  for (Event ev : me) {

代码示例来源:origin: net.sf.okapi/okapi-core

private void convertRefs (Event event) {
  if ( event.isMultiEvent() ) {
    MultiEvent me = event.getMultiEvent();
    for (Event e : me) {
      convertRefs(e);
    }
  }
  else {
    if ( event.isTextUnit() ) {
      ITextUnit tu = event.getTextUnit();
      convertTextContainer(tu.getSource());
      for (LocaleId locId : tu.getTargetLocales()) {
        convertTextContainer(tu.getTarget(locId));
      }                
    }
    
    ISkeleton skel = event.getResource().getSkeleton();
    subFilter.convertRefsInSkeleton(skel);            
  }
}

相关文章