Package diva.util
Class IteratorUtilities
- java.lang.Object
-
- diva.util.IteratorUtilities
-
public class IteratorUtilities extends java.lang.ObjectA collection of utilities dealing with iterators.- Version:
- $Id$
- Author:
- John Reekie, Michael Shilman
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.ObjectfirstMatch(java.util.Iterator i, Filter f)Return the first element in an iterator that matches the given filter, or null if there isn't one.static java.lang.ObjectfirstNotMatch(java.util.Iterator i, Filter f)Return the first element in an iterator that doesn't match the given filter, or null if there isn't one.static voidprintElements(java.lang.String prefix, java.lang.String desc, java.util.Iterator i)Print every element of an iterator to stdout.static voidprintElements(java.lang.String desc, java.util.Iterator i)Print every element of an iterator to stdout.
-
-
-
Method Detail
-
firstMatch
public static java.lang.Object firstMatch(java.util.Iterator i, Filter f)Return the first element in an iterator that matches the given filter, or null if there isn't one.
-
firstNotMatch
public static java.lang.Object firstNotMatch(java.util.Iterator i, Filter f)Return the first element in an iterator that doesn't match the given filter, or null if there isn't one.
-
printElements
public static void printElements(java.lang.String desc, java.util.Iterator i)Print every element of an iterator to stdout. The string argument is printed first, and then each element is printed on a new line but indented.
-
printElements
public static void printElements(java.lang.String prefix, java.lang.String desc, java.util.Iterator i)Print every element of an iterator to stdout. The string argument is printed first with the prefix argument leading it; then each element is printed on a new line with additional indentation.
-
-