java.util.Collections.emptyListIterator()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(179)

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

Collections.emptyListIterator介绍

[英]Returns a list iterator containing no elements.
[中]返回不包含任何元素的列表迭代器。

代码示例

代码示例来源:origin: wildfly/wildfly

assertTrue(immutability.test(Collections.emptyIterator()));
assertTrue(immutability.test(Collections.emptyList()));
assertTrue(immutability.test(Collections.emptyListIterator()));
assertTrue(immutability.test(Collections.emptyMap()));
assertTrue(immutability.test(Collections.emptyNavigableMap()));

代码示例来源:origin: apache/opennlp

@Override
public void reset() throws IOException, UnsupportedOperationException {
 eventIt = Collections.emptyListIterator();
 sequenceStream.reset();
}

代码示例来源:origin: apache/opennlp

@Override
 public void close() throws IOException {
  eventIt = Collections.emptyListIterator();
  sequenceStream.close();
 }
}

代码示例来源:origin: apache/opennlp

@Override
 protected Iterator<Event> createEvents(ChunkSample sample) {

  if (sample != null) {
   List<Event> events = new ArrayList<>();
   String[] toksArray = sample.getSentence();
   String[] tagsArray = sample.getTags();
   String[] predsArray = sample.getPreds();
   for (int ei = 0, el = sample.getSentence().length; ei < el; ei++) {
    events.add(new Event(predsArray[ei], cg.getContext(ei,toksArray,tagsArray,predsArray)));
   }

   return events.iterator();
  }
  else {
   return Collections.emptyListIterator();
  }
 }
}

代码示例来源:origin: apache/opennlp

protected Iterator<Event> createEvents(LemmaSample sample) {

  if (sample != null) {
   List<Event> events = new ArrayList<>();
   String[] toksArray = sample.getTokens();
   String[] tagsArray = sample.getTags();
   String[] lemmasArray = LemmatizerME.encodeLemmas(toksArray,sample.getLemmas());
   for (int ei = 0, el = sample.getTokens().length; ei < el; ei++) {
    events.add(new Event(lemmasArray[ei],
      contextGenerator.getContext(ei,toksArray,tagsArray,lemmasArray)));
   }
   return events.iterator();
  }
  else {
   return Collections.emptyListIterator();
  }
 }
}

代码示例来源:origin: apache/phoenix

public static void serializeServerMaintainedIndexes(PTable dataTable, ImmutableBytesWritable ptr,
    List<PTable> indexes, PhoenixConnection connection) {
  Iterator<PTable> indexesItr = Collections.emptyListIterator();
  boolean onlyLocalIndexes = dataTable.isImmutableRows() || dataTable.isTransactional();
  if (onlyLocalIndexes) {
    if (!dataTable.isTransactional()
        || !dataTable.getTransactionProvider().getTransactionProvider().isUnsupported(Feature.MAINTAIN_LOCAL_INDEX_ON_SERVER)) {
      indexesItr = maintainedLocalIndexes(indexes.iterator());
    }
  } else {
    indexesItr = maintainedIndexes(indexes.iterator());
  }

  serialize(dataTable, ptr, Lists.newArrayList(indexesItr), connection);
}
/**

代码示例来源:origin: BaseXdb/basex

@Override
public ListIterator<Value> iterator(final long size) {
 return Collections.emptyListIterator();
}

代码示例来源:origin: com.github.mygreen/standalone-el

@Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(final ELContext context, final Object base) {
  
  return base == null ? null : Collections.<FeatureDescriptor>emptyListIterator();
}

代码示例来源:origin: zolyfarkas/spf4j

@Override
public Iterator<Marker> iterator() {
 return Collections.emptyListIterator();
}

代码示例来源:origin: org.basex/basex

@Override
public ListIterator<Value> iterator(final long size) {
 return Collections.emptyListIterator();
}

代码示例来源:origin: net.nullschool/grains-core

@Override public ListIterator<E> listIterator(int index) {
  if (index != 0) {
    throw new IndexOutOfBoundsException();
  }
  return Collections.emptyListIterator();
}

代码示例来源:origin: stackoverflow.com

Collections.emptySet()
Optional.empty()
Comparator.naturalOrder()
Collections.emptyListIterator()

代码示例来源:origin: org.apache.opennlp/opennlp-tools

@Override
public void reset() throws IOException, UnsupportedOperationException {
 eventIt = Collections.emptyListIterator();
 sequenceStream.reset();
}

代码示例来源:origin: ai.idylnlp/idylnlp-opennlp-tools-1.8.3

@Override
public void reset() throws IOException, UnsupportedOperationException {
 eventIt = Collections.emptyListIterator();
 sequenceStream.reset();
}

代码示例来源:origin: org.apache.opennlp/opennlp-tools

@Override
 public void close() throws IOException {
  eventIt = Collections.emptyListIterator();
  sequenceStream.close();
 }
}

代码示例来源:origin: ModeShape/modeshape

@Override
public Iterator<ChildReference> iterator( Name name, Context context ) {
  // since SNS are not support, simply check if there is a node with this name or not
  ChildReference ref = getChild(name, 1, context);
  return ref != null ? Collections.singletonList(ref).iterator() : Collections.<ChildReference>emptyListIterator();
}

代码示例来源:origin: com.blazebit/blaze-persistence-core-api

@Override
public ListIterator<T> listIterator(int index) {
  checkIndex(index);
  return Collections.emptyListIterator();
}

代码示例来源:origin: ai.idylnlp/idylnlp-opennlp-tools-1.8.3

@Override
 public void close() throws IOException {
  eventIt = Collections.emptyListIterator();
  sequenceStream.close();
 }
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

@Override
public Iterator<ChildReference> iterator( Name name, Context context ) {
  // since SNS are not support, simply check if there is a node with this name or not
  ChildReference ref = getChild(name, 1, context);
  return ref != null ? Collections.singletonList(ref).iterator() : Collections.<ChildReference>emptyListIterator();
}

代码示例来源:origin: BaseXdb/basex

/**
 * Returns a list iterator for the given finger tree starting at the given position.
 * @param <E> element type
 * @param tree finger tree
 * @param start starting position
 * @return the iterator
 */
static <E> ListIterator<E> get(final FingerTree<?, E> tree, final long start) {
 if(tree.isEmpty()) return Collections.emptyListIterator();
 if(tree instanceof SingletonTree) return new FingerTreeIterator<>(tree.head(), start);
 return new FingerTreeIterator<>((DeepTree<?, E>) tree, start);
}

相关文章

Collections类方法