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


Java Iterators.singletonIterator方法代码示例

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


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

示例1: iterator

import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public UnmodifiableIterator<E> iterator() {
  E connectingEdge = getConnectingEdge();
  return (connectingEdge == null)
      ? ImmutableSet.<E>of().iterator()
      : Iterators.singletonIterator(connectingEdge);
}
 
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:8,代码来源:EdgesConnecting.java

示例2: readSingleChunk

import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Test
public void readSingleChunk() throws IOException {
  ByteString hello = ByteString.copyFromUtf8("Hello, World");
  InputStream in = new ByteStringIteratorInputStream(
      Iterators.<ByteString>singletonIterator(hello));
  byte[] data = new byte[hello.size()];

  assertThat(in.read(data)).isEqualTo(hello.size());
  assertThat(ByteString.copyFrom(data)).isEqualTo(hello);
  assertThat(in.read()).isEqualTo(-1);
}
 
开发者ID:bazelbuild,项目名称:bazel-buildfarm,代码行数:12,代码来源:ByteStringIteratorInputStreamTest.java

示例3: iterator

import com.google.common.collect.Iterators; //导入方法依赖的package包/类
public Iterator<Slice> iterator()
{
    return Iterators.singletonIterator(Slice.ALL);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:5,代码来源:Slices.java

示例4: iterator

import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<LogicalOperator> iterator() {
  return Iterators.singletonIterator(getInput());
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:5,代码来源:Limit.java

示例5: TreeIterator

import com.google.common.collect.Iterators; //导入方法依赖的package包/类
public TreeIterator(Instance instance, Digest rootDigest, String pageToken) {
  this.instance = instance;
  parentPath = new ArrayDeque<Digest>();
  pointers = new Stack<Iterator<Digest>>();

  Iterator<Digest> iter = Iterators.singletonIterator(rootDigest);

  Directory directory = expectDirectory(instance.getBlob(rootDigest));

  if (!pageToken.isEmpty()) {
    TreeIteratorToken token = parseToken(BaseEncoding.base64().decode(pageToken));

    for (Digest digest : token.getDirectoriesList()) {
      boolean found = false;
      while (!found && iter.hasNext()) {
        if (iter.next().equals(digest)) {
          found = true;
        }
      }
      if (!found) {
        throw new IllegalArgumentException();
      }
      parentPath.addLast(digest);
      pointers.push(iter);
      directory = expectDirectory(instance.getBlob(digest));
      if (directory == null) {
        // some directory data has disappeared, current iter
        // is correct and will be next directory fetched
        break;
      }
      iter = Iterators.transform(
          directory.getDirectoriesList().iterator(),
          directoryNode -> {
            return directoryNode.getDigest();
          });
    }
  }
  pointers.push(iter);
  path = parentPath.clone();
  advanceIterator();
}
 
开发者ID:bazelbuild,项目名称:bazel-buildfarm,代码行数:42,代码来源:TreeIterator.java

示例6: iterator

import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<LogicalOperator> iterator() {
    return Iterators.singletonIterator(getInput());
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:5,代码来源:Order.java

示例7: iterator

import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<LogicalOperator> iterator() {
  return Iterators.singletonIterator(input);
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:5,代码来源:SingleInputOperator.java

示例8: iterator

import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<LogicalOperator> iterator() {
    return Iterators.singletonIterator(stream.get(stream.size() - 1));
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:5,代码来源:Sequence.java

示例9: childrenIterator

import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<Tree> childrenIterator() {
  return Iterators.singletonIterator(operator);
}
 
开发者ID:racodond,项目名称:sonar-css-plugin,代码行数:5,代码来源:ScssOperatorTreeImpl.java

示例10: iterator

import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<LogicalExpression> iterator() {
  return Iterators.singletonIterator(child);
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:5,代码来源:ValueVectorWriteExpression.java

示例11: childrenIterator

import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<Tree> childrenIterator() {
  return Iterators.singletonIterator(selector);
}
 
开发者ID:racodond,项目名称:sonar-css-plugin,代码行数:5,代码来源:KeyframesSelectorTreeImpl.java

示例12: childrenIterator

import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<Tree> childrenIterator() {
  return Iterators.singletonIterator(parentSelector);
}
 
开发者ID:racodond,项目名称:sonar-css-plugin,代码行数:5,代码来源:LessParentSelectorTreeImpl.java

示例13: iterator

import com.google.common.collect.Iterators; //导入方法依赖的package包/类
@Override
public Iterator<PhysicalOperator> iterator() {
    return Iterators.singletonIterator(child);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:5,代码来源:WriterCommitterPOP.java


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