org.ijsberg.iglu.util.collection
Class CollectionSupport

java.lang.Object
  extended by org.ijsberg.iglu.util.collection.CollectionSupport

public abstract class CollectionSupport
extends Object

Contains static methods for formatting of collections, as well as arrays and maps. Print methods print to standard out by default and use an end of line (EOL) as separator.


Field Summary
static String LINE_SEP
           
 
Constructor Summary
CollectionSupport()
           
 
Method Summary
static String format(Collection coll, String separator)
           
static String format(Map map, String separator)
           
static String format(String itemPrefix, Collection coll, String separator)
           
static void print(Collection coll)
          Prints a collection to standard out.
static void print(Collection coll, PrintStream out)
          Prints every item of a collection on a separate line to the given output stream.
static void print(Collection coll, PrintStream out, String separator)
          Prints a collection to the given output stream.
static void print(Map map)
           
static void print(Map map, PrintStream out)
           
static void print(Map map, PrintStream out, String separator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEP

public static final String LINE_SEP
Constructor Detail

CollectionSupport

public CollectionSupport()
Method Detail

print

public static void print(Collection coll)
Prints a collection to standard out.

Parameters:
coll -

print

public static void print(Collection coll,
                         PrintStream out)
Prints every item of a collection on a separate line to the given output stream.

Parameters:
coll -
out - stream to print to

print

public static void print(Collection coll,
                         PrintStream out,
                         String separator)
Prints a collection to the given output stream.

Parameters:
coll -
out - stream to print to
separator - item separator

format

public static String format(Collection coll,
                            String separator)
Parameters:
coll -
separator - item separator
Returns:
formatted collection

format

public static String format(String itemPrefix,
                            Collection coll,
                            String separator)
Parameters:
itemPrefix -
coll -
separator - item separator
Returns:
formatted collection

print

public static void print(Map map)
Parameters:
map -

print

public static void print(Map map,
                         PrintStream out)
Parameters:
map -
out -

print

public static void print(Map map,
                         PrintStream out,
                         String separator)
Parameters:
map -
out -
separator -

format

public static String format(Map map,
                            String separator)
Parameters:
map -
separator -
Returns:


Copyright © 2011. All Rights Reserved.