litesoft
@ 938
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
// This Source Code is in the Public Domain per: http://litesoft.org/License.txt package org.litesoft.core.util; import java.util.*; /** * A utility class with various static methods for Iterator related * functions.<p> * <p/> * <p/> * When the first parameter is the appropriate type (Iterator), and can NOT be * null, by convention, I place these methods in a aaaHelper class.<p> * <p/> * See <a href="IteratorHelper.html">IteratorHelper</a><p> * <p/> * This class is non-instantiable.<p> * * @author George Smith * @version 1.0 7/28/01 */ public class IteratorUtil { private IteratorUtil() { } /** * Returns a debug/human friendly <i>label</i>ed String that represents * the <i>iterator</i>.<p> * * @param pIterator the Iterator to dump (null OK). * @param pLabel the label for the Iterator (null OK).<p> * * @return A <i>label</i>ed String that represents <i>iterator</i>. */ public static String toString( Iterator pIterator, String pLabel ) { if ( pIterator != null ) { return IteratorHelper.toString( pIterator, pLabel ); } return ((pLabel == null) ? "" : pLabel + ": ") + "null"; } } |