List of utility methods to do Iterator
String | printContainer(Iterator print Container String ret = ""; while (it.hasNext()) { ret += it.next().toString(); if (it.hasNext()) { ret += sep; return ret; ... |
void | printElements(String desc, Iterator i) Print every element of an iterator to stdout. printElements("", desc, i);
|
void | printIterator(final Iterator Helper method for printing the content from an Iterator. int i = 1; while (iterator.hasNext()) { final T element = iterator.next(); System.out.println(i + ".)Element:" + element); i++; |
void | printIterator(Iterator i, String header) print Iterator System.out.println(header); for (int c = 0; c < header.length(); c++) System.out.print("="); System.out.println(); if (i.hasNext()) { while (i.hasNext()) System.out.println(i.next()); } else ... |
void | printIterator(Iterator print Iterator while (it.hasNext()) { Map.Entry<K, V> entry = it.next(); System.out.println(entry.getKey() + " " + entry.getValue()); |
void | put(String key, Iterator put iteratorMap.put(key, value); |
Map | putAllFromAll(Map Puts all entries from all maps in the range of an iterator to a given map. for (Map<K, V> eachMap : in(mapsIterator)) { map.putAll(eachMap); return map; |
int | read(Iterator read int i = 0; for (; i < array.length && it.hasNext();) { E item = it.next(); if (item != null) { array[i++] = item; return i; ... |
Set | reduceSet(Iterator A helper method for set MapReduce. Set<T> set = new HashSet<>(); while (values.hasNext()) { set.addAll(values.next()); return set; |
boolean | removeAll(Collection> collection, Iterator> itemsToRemove) Removes from a collection all items retrieved from a specified iterator. boolean modified = false; while (itemsToRemove.hasNext()) { Object o = itemsToRemove.next(); while (true) { if (collection.remove(o)) { modified = true; } else { break; ... |