org.barracudamvc.plankton
Class StringUtil

java.lang.Object
  extended by org.barracudamvc.plankton.StringUtil

public class StringUtil
extends Object

Simple utility functions that work on Strings TODO - can't this be relaced by java.lang.String.replaceAll() [jdk 1.4] - A: probably not; that funtion uses regexps; this one doesn't


Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
StringUtil()
           
 
Method Summary
static String getDescr(Object obj)
           
static Calendar getElapsed(long elapsed)
          get a Calendar representing an elapsed amt of time
static String getElapsedStr(long elapsed)
          get a String describing an elapsed amt of time (format: "XX hrs, YY mins, ZZ secs (MMMM millis)")
static String getElapsedStr(long elapsed, int granularity)
          get a String describing an elapsed amt of time (format: "XX hrs, YY mins, ZZ secs").
static String getIdentity(Object obj)
          Return an identity string for the given object.
static String replace(String sourceStr, String oldPattern, String newPattern)
          Replace all occurences of a pattern in a String with a new pattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
Constructor Detail

StringUtil

public StringUtil()
Method Detail

replace

public static String replace(String sourceStr,
                             String oldPattern,
                             String newPattern)
Replace all occurences of a pattern in a String with a new pattern

Parameters:
sourceStr - the source string
oldPattern - the old pattern
newPattern - the new pattern
Returns:
an adjusted String

getElapsed

public static Calendar getElapsed(long elapsed)
get a Calendar representing an elapsed amt of time

Since:
csc_010404_1

getElapsedStr

public static String getElapsedStr(long elapsed)
get a String describing an elapsed amt of time (format: "XX hrs, YY mins, ZZ secs (MMMM millis)")

Since:
csc_010404_1

getElapsedStr

public static String getElapsedStr(long elapsed,
                                   int granularity)
get a String describing an elapsed amt of time (format: "XX hrs, YY mins, ZZ secs"). Granularity are calendar constants MILLISECOND, SECOND, MINUTE, or HOUR.

Since:
csc_010404_1

getIdentity

public static String getIdentity(Object obj)
Return an identity string for the given object.

Since:
saw_102103_1

getDescr

public static String getDescr(Object obj)


Copyright © 2006 BarracudaMVC.org All Rights Reserved.