Java 类com.intellij.util.containers.EmptyIterator 实例源码

项目:intellij-ce-playground    文件:GraphGeneratorTest.java   
public void testEmptyGraph() {
  final TestNode node = new TestNode("A");
  final GraphGenerator<TestNode> graphGenerator = new GraphGenerator<TestNode>(new GraphGenerator.SemiGraph<TestNode>() {
      @Override
      public Collection<TestNode> getNodes() {
        return Arrays.asList(new TestNode[]{node});
      }

      @Override
      public Iterator<TestNode> getIn(TestNode n) {
        return EmptyIterator.getInstance();
      }
    });

  assertFalse(graphGenerator.getOut(node).hasNext());
}
项目:tools-idea    文件:GraphGeneratorTest.java   
public void testEmptyGraph() {
  final TestNode node = new TestNode("A");
  final GraphGenerator<TestNode> graphGenerator = new GraphGenerator<TestNode>(new GraphGenerator.SemiGraph<TestNode>() {
      @Override
      public Collection<TestNode> getNodes() {
        return Arrays.asList(new TestNode[]{node});
      }

      @Override
      public Iterator<TestNode> getIn(TestNode n) {
        return EmptyIterator.getInstance();
      }
    });

  assertFalse(graphGenerator.getOut(node).hasNext());
}
项目:consulo    文件:GraphGeneratorTest.java   
public void testEmptyGraph() {
  final TestNode node = new TestNode("A");
  final GraphGenerator<TestNode> graphGenerator = new GraphGenerator<TestNode>(new GraphGenerator.SemiGraph<TestNode>() {
      @Override
      public Collection<TestNode> getNodes() {
        return Arrays.asList(new TestNode[]{node});
      }

      @Override
      public Iterator<TestNode> getIn(TestNode n) {
        return EmptyIterator.getInstance();
      }
    });

  assertFalse(graphGenerator.getOut(node).hasNext());
}
项目:consulo    文件:ImmutableSameTypeAttributeList.java   
@Nonnull
@Override
public Iterator<Attribute> iterator() {
  if (isEmpty()) return EmptyIterator.getInstance();
  return new Iterator<Attribute>() {
    int i;
    @Override
    public boolean hasNext() {
      return i < size();
    }

    @Override
    public Attribute next() {
      return get(i++);
    }

    @Override
    public void remove() {
      throw ImmutableElement.immutableError(ImmutableSameTypeAttributeList.this);
    }
  };
}
项目:intellij-ce-playground    文件:LoopAnalyzer.java   
@NotNull
private Iterator<Instruction> indicesToInstructions(int[] next) {
  if (next == null) return EmptyIterator.getInstance();
  List<Instruction> out = new ArrayList<Instruction>(next.length);
  for (int i : next) {
    out.add(myInstructions[i]);
  }
  return out.iterator();
}
项目:intellij-ce-playground    文件:TreeBasedMap.java   
private boolean pushNode(final @NotNull String name, @NotNull Node<T> node) {
  final HashMap<String, Node<T>> childrenMap = node.myChildren;
  final boolean hasChildren = childrenMap != null && childrenMap.size() > 0;
  if (hasChildren || node.mappingExists()) {
    myCurrentNodePath.push(new PathElement<T>(node, hasChildren? childrenMap.keySet().iterator() : EmptyIterator.<String>getInstance()));
    if (myCurrentNodePath.size() > 2) {
      // do not add separator before the Root and its direct child nodes 
      myCurrentName.append(mySeparator);
    }
    myCurrentName.append(name);
    return true;
  }
  return false;
}
项目:intellij-ce-playground    文件:SmartList.java   
@NotNull
@Override
public Iterator<E> iterator() {
  if (mySize == 0) {
    return EmptyIterator.getInstance();
  }
  if (mySize == 1) {
    return new SingletonIterator();
  }
  return super.iterator();
}
项目:tools-idea    文件:TreeBasedMap.java   
private boolean pushNode(final @NotNull String name, @NotNull Node<T> node) {
  final HashMap<String, Node<T>> childrenMap = node.myChildren;
  final boolean hasChildren = childrenMap != null && childrenMap.size() > 0;
  if (hasChildren || node.mappingExists()) {
    myCurrentNodePath.push(new PathElement<T>(node, hasChildren? childrenMap.keySet().iterator() : EmptyIterator.<String>getInstance()));
    if (myCurrentNodePath.size() > 2) {
      // do not add separator before the Root and its direct child nodes 
      myCurrentName.append(mySeparator);
    }
    myCurrentName.append(name);
    return true;
  }
  return false;
}
项目:tools-idea    文件:SmartList.java   
@NotNull
@Override
public Iterator<E> iterator() {
  if (mySize == 0) {
    return EmptyIterator.getInstance();
  }
  if (mySize == 1) {
    return new SingletonIterator();
  }
  return super.iterator();
}
项目:jediterm    文件:SmartList.java   
@NotNull
@Override
public Iterator<E> iterator() {
  if (mySize == 0) {
    return EmptyIterator.getInstance();
  }
  if (mySize == 1) {
    return new SingletonIterator();
  }
  return super.iterator();
}
项目:consulo    文件:SmartList.java   
@Nonnull
@Override
public Iterator<E> iterator() {
  if (mySize == 0) {
    return EmptyIterator.getInstance();
  }
  if (mySize == 1) {
    return new SingletonIterator();
  }
  return super.iterator();
}
项目:consulo-java    文件:LoopAnalyzer.java   
@NotNull
private Iterator<Instruction> indicesToInstructions(int[] next)
{
    if(next == null)
    {
        return EmptyIterator.getInstance();
    }
    List<Instruction> out = new ArrayList<>(next.length);
    for(int i : next)
    {
        out.add(myInstructions[i]);
    }
    return out.iterator();
}
项目:intellij-ce-playground    文件:FragmentList.java   
@Override
public Iterator<Fragment> iterator() {
  return EmptyIterator.getInstance();
}
项目:tools-idea    文件:FragmentList.java   
public Iterator<Fragment> iterator() {
  return EmptyIterator.getInstance();
}
项目:consulo    文件:ArchiveFile.java   
@Nonnull
@Override
public Iterator<? extends ArchiveEntry> entries() {
  return EmptyIterator.getInstance();
}
项目:consulo    文件:FragmentList.java   
public Iterator<Fragment> iterator() {
  return EmptyIterator.getInstance();
}