sk.uniba.euromath.tools
Class StringTools

java.lang.Object
  extended by sk.uniba.euromath.tools.StringTools

public class StringTools
extends Object

Contains various string tools.

Author:
Martin Vysny

Method Summary
static String format(String msg, Object... params)
          Processes the message and replaces every %[number] with correspoding Object.toString() from array params with index [number].
static int resolveIndex(String source, int sourceIndex, String result)
          Tries to resolve the index from given string to the result string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

format

public static String format(String msg,
                            Object... params)
Processes the message and replaces every %[number] with correspoding Object.toString() from array params with index [number]. 0 is first Object, 1 second etc. Currently only numbers 0-9 are supported.

Parameters:
msg - message to process
params - parameters for message
Returns:
formatted message

resolveIndex

public static int resolveIndex(String source,
                               int sourceIndex,
                               String result)
Tries to resolve the index from given string to the result string. This method expects that strings differ only by whitespaces.

Parameters:
source - the result of the transformation
sourceIndex - index into the sourceResult string.
result - the result string.
Returns:
index into the result string.


Copyright © 2003-2006 null. All Rights Reserved.