thinktank.j2me
Class TTUtils

java.lang.Object
  extended by thinktank.j2me.TTUtils

public final class TTUtils
extends java.lang.Object

Useful J2ME utility methods which offer some level of similarity to familiar J2SE methods.


Nested Class Summary
static interface TTUtils.ILogger
          Allows TTUtils to redirect the log info to a class of your choice.
 
Constructor Summary
TTUtils()
           
 
Method Summary
static void log(java.lang.String message)
          If an TTUtils.ILogger has been registered via registerLogger(thinktank.j2me.TTUtils.ILogger) then the message will be sent there, otherwise will be printed on System.out.
static java.lang.String readLine(java.io.InputStream input)
          Read a line from the input, with newlines stripped.
static void registerLogger(TTUtils.ILogger logger)
           
static java.lang.String[] stringSplit(java.lang.String string, char separator)
          J2ME implementation of String.split().
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TTUtils

public TTUtils()
Method Detail

log

public static void log(java.lang.String message)
If an TTUtils.ILogger has been registered via registerLogger(thinktank.j2me.TTUtils.ILogger) then the message will be sent there, otherwise will be printed on System.out.

Parameters:
message -

readLine

public static java.lang.String readLine(java.io.InputStream input)
                                 throws java.io.IOException
Read a line from the input, with newlines stripped. Consecutive newlines are ignored. null is returned when we attempt to read beyond the end of the stream.

Parameters:
input -
Returns:
Throws:
java.io.IOException

registerLogger

public static void registerLogger(TTUtils.ILogger logger)
Parameters:
logger - null to deregister

stringSplit

public static java.lang.String[] stringSplit(java.lang.String string,
                                             char separator)
J2ME implementation of String.split(). Is very fragile.

Parameters:
string -
separator -
Returns: