org.barracudamvc.plankton.data
Class CollectionsUtil

java.lang.Object
  extended byorg.barracudamvc.plankton.data.CollectionsUtil

public class CollectionsUtil
extends Object

Collections utilities


Constructor Summary
CollectionsUtil()
           
 
Method Summary
static boolean checkEquals(Object o1, Object o2)
          Check if o1 is equivalent to o2.
protected static void print(org.apache.log4j.Logger extLogger, OutputStream out, String s)
           
static void printStackTrace(List list)
          utility method to recursively print the stack trace for a List.
static void printStackTrace(List list, int depth, org.apache.log4j.Logger extLogger, OutputStream out)
          utility method to recursively print the stack trace for a List Bounds:
If depth < 0, the method returns immediately
static void printStackTrace(List list, org.apache.log4j.Logger extLogger)
          utility method to recursively print the stack trace for a List.
static void printStackTrace(List list, OutputStream out)
          utility method to recursively print the stack trace for a List.
static void printStackTrace(Map map)
          utility method to recursively print the stack trace for a Map.
static void printStackTrace(Map map, int depth, org.apache.log4j.Logger extLogger, OutputStream out)
          utility method to recursively print the stack trace for a Map Map Specification: depth < 0 will be remapped to 0 depth > 25 will be remapped to 25 Passing in a null value for the output stream will cause all the necessary output information to be generated, but nothing will actually print anywhere.
static void printStackTrace(Map map, org.apache.log4j.Logger extLogger)
          utility method to recursively print the stack trace for a Map.
static void printStackTrace(Map map, OutputStream out)
          utility method to recursively print the stack trace for a Map.
static void printStackTrace(Object[] objarray)
          utility method to recursively print the stack trace for a Object[].
static void printStackTrace(Object[] objarray, int depth, org.apache.log4j.Logger extLogger, OutputStream out)
          utility method to recursively print the stack trace for an Object[] Bounds:
If depth < 0, the method returns immediately
static void printStackTrace(Object[] objarray, org.apache.log4j.Logger extLogger)
          utility method to recursively print the stack trace for a Object[].
static void printStackTrace(Object[] objarray, OutputStream out)
          utility method to recursively print the stack trace for a Object[].
protected static void printStackTrace(StateMap map, int depth, org.apache.log4j.Logger extLogger, OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionsUtil

public CollectionsUtil()
Method Detail

checkEquals

public static boolean checkEquals(Object o1,
                                  Object o2)
Check if o1 is equivalent to o2. Takes into java.sql.Dates (where .equals()) doesn't work as you'd expect) and Comparables (where you really want to use .compareTo() rather than .equals()).

Parameters:
o1 - object1
o2 - object2

printStackTrace

public static void printStackTrace(Map map)

utility method to recursively print the stack trace for a Map.

Parameters:
map - the Map we wish to dump

printStackTrace

public static void printStackTrace(Map map,
                                   org.apache.log4j.Logger extLogger)

utility method to recursively print the stack trace for a Map.

Parameters:
map - the Map we wish to dump
extLogger - the Logger we wish to dump it to

printStackTrace

public static void printStackTrace(Map map,
                                   OutputStream out)

utility method to recursively print the stack trace for a Map.

Parameters:
map - the Map we wish to dump
out - the output stream we wish to dump it to

printStackTrace

public static void printStackTrace(Map map,
                                   int depth,
                                   org.apache.log4j.Logger extLogger,
                                   OutputStream out)

utility method to recursively print the stack trace for a Map

Map Specification:

  1. depth < 0 will be remapped to 0
  2. depth > 25 will be remapped to 25

Passing in a null value for the output stream will cause all the necessary output information to be generated, but nothing will actually print anywhere. This is useful for bounds testing when you want to make sure the routine is working but you don't really care about the output.

Parameters:
map - the Map we wish to dump
depth - inset depth at which to start printing
extLogger - the Logger we wish to dump it to (may be null)
out - OutputStream to print to (only used if extLogger is null)

printStackTrace

protected static void printStackTrace(StateMap map,
                                      int depth,
                                      org.apache.log4j.Logger extLogger,
                                      OutputStream out)

printStackTrace

public static void printStackTrace(List list)

utility method to recursively print the stack trace for a List.

Parameters:
list - the List we wish to dump

printStackTrace

public static void printStackTrace(List list,
                                   org.apache.log4j.Logger extLogger)

utility method to recursively print the stack trace for a List.

Parameters:
list - the List we wish to dump
extLogger - the Logger we wish to dump it to

printStackTrace

public static void printStackTrace(List list,
                                   OutputStream out)

utility method to recursively print the stack trace for a List.

Parameters:
list - the Map we wish to dump
out - the output stream we wish to dump it to

printStackTrace

public static void printStackTrace(List list,
                                   int depth,
                                   org.apache.log4j.Logger extLogger,
                                   OutputStream out)

utility method to recursively print the stack trace for a List

Bounds:
If depth < 0, the method returns immediately

Parameters:
list - the List we wish to dump
depth - inset depth at which to start printing
extLogger - the Logger we wish to dump it to (may be null)
out - OutputStream to print to (only used if extLogger is null)

printStackTrace

public static void printStackTrace(Object[] objarray)

utility method to recursively print the stack trace for a Object[].

Parameters:
objarray - the Object[] we wish to dump

printStackTrace

public static void printStackTrace(Object[] objarray,
                                   org.apache.log4j.Logger extLogger)

utility method to recursively print the stack trace for a Object[].

Parameters:
objarray - the Object[] we wish to dump
extLogger - the Logger we wish to dump it to

printStackTrace

public static void printStackTrace(Object[] objarray,
                                   OutputStream out)

utility method to recursively print the stack trace for a Object[].

Parameters:
objarray - the Object[] we wish to dump
out - the output stream we wish to dump it to

printStackTrace

public static void printStackTrace(Object[] objarray,
                                   int depth,
                                   org.apache.log4j.Logger extLogger,
                                   OutputStream out)

utility method to recursively print the stack trace for an Object[]

Bounds:
If depth < 0, the method returns immediately

Parameters:
objarray - the Object[] we wish to dump
depth - inset depth at which to start printing
extLogger - the Logger we wish to dump it to (may be null)
out - the OutputStream to print to (only used if extLogger is null)

print

protected static void print(org.apache.log4j.Logger extLogger,
                            OutputStream out,
                            String s)


Copyright © 2004 BarracudaMVC.org All Rights Reserved.