MCPcopy Index your code
hub / github.com/antlr/codebuff / get

Method get

output/java_guava/1.4.18/Iterators.java:813–823  ·  view source on GitHub ↗

Advances iterator position + 1 times, returning the element at the positionth position. @param position position of the element to return @return the element at the specified position in iterator @throws IndexOutOfBoundsException if position is negative or

(Iterator<T> iterator, int position)

Source from the content-addressed store, hash-verified

811
812
813 public static <T> T get(Iterator<T> iterator, int position) {
814 checkNonnegative(position);
815 int skipped = advance(iterator, position);
816 if (!iterator.hasNext()) {
817 throw new IndexOutOfBoundsException("position (" + position
818 + ") must be less than the number of elements that remained ("
819 + skipped
820 + ")");
821 }
822 return iterator.next();
823 }
824
825
826 static void checkNonnegative(int position) {

Callers 1

getMethod · 0.95

Calls 5

checkNonnegativeMethod · 0.95
advanceMethod · 0.95
getNextMethod · 0.95
nextMethod · 0.65
hasNextMethod · 0.45

Tested by

no test coverage detected