org.objectweb.telosys.util
Class Parts

java.lang.Object
  extended byorg.objectweb.telosys.util.Parts

public class Parts
extends java.lang.Object

Set of functions to cut a string in parts, using a given separator character


Constructor Summary
Parts()
           
 
Method Summary
static java.lang.String[] getParts(java.lang.String s, char cSeparator, int iMaxParts)
          Returns the differents parts of the given string
static int[] getSeparators(java.lang.String str, char cSeparator, int iMaxSep)
          Returns an array of separators positions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parts

public Parts()
Method Detail

getSeparators

public static int[] getSeparators(java.lang.String str,
                                  char cSeparator,
                                  int iMaxSep)
Returns an array of separators positions

Parameters:
str - the string where to search the separators
cSeparator - the separator character
iMaxSep - the maximum number of separators
Returns:

getParts

public static java.lang.String[] getParts(java.lang.String s,
                                          char cSeparator,
                                          int iMaxParts)
Returns the differents parts of the given string

Parameters:
s - the string to cut
cSeparator - the separator character
iMaxParts - the maximum number of parts
Returns:
the parts array (never null, can has 0 elements )