de.smartics.exceptions.report.utils
Class StringFunction

java.lang.Object
  extended by de.smartics.exceptions.report.utils.StringFunction

public final class StringFunction
     
     
extends Object

Utils for String functions.


Method Summary
static String capitalize(String input)
          This method transforms the first character to upper case and returns the result.
static int indexOfFirstWhiteSpace(int offset, StringBuilder buffer)
          Returns the index of the first white space, starting at the given offset.
static int indexOfFirstWhiteSpace(String string)
          Returns the index of the first white space.
static int indexOfFirstWhiteSpace(StringBuilder buffer)
          Returns the index of the first white space.
static int indexOfSecondWhiteSpace(String string)
          Returns the index of the second white space.
static int indexOfSecondWhiteSpace(StringBuilder buffer)
          Returns the index of the second white space.
static List<String> split(String delimiterSeparatedElements)
          Parses the string and returns the comma separated elements as a list of String objects.
static List<String> split(String delimiterSeparatedElements, String delimiters)
          Parses the string and returns the delimiter separated elements as a list of String objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

capitalize

public static String capitalize(String input)
This method transforms the first character to upper case and returns the result.

Parameters:
input - the string to transform.
Returns:
the captialized string.

split

public static List<String> split(String delimiterSeparatedElements)
Parses the string and returns the comma separated elements as a list of String objects. If the string is null or contains no character (its length is zero), the empty list is returned.

Parameters:
delimiterSeparatedElements - the string to parse, trimmed from whitespaces.
Returns:
a list of trimmed strings.

split

public static List<String> split(String delimiterSeparatedElements,
                                 String delimiters)
Parses the string and returns the delimiter separated elements as a list of String objects. If the string is null or contains no character (its length is zero), the empty list is returned.

Parameters:
delimiterSeparatedElements - the string to parse, trimmed from whitespaces.
delimiters - a string that contains all delimiters used to split the string.
Returns:
a list of trimmed strings.

indexOfFirstWhiteSpace

public static int indexOfFirstWhiteSpace(StringBuilder buffer)
Returns the index of the first white space.

Parameters:
buffer - the buffer to be analyzed.
Returns:
the index of the first white space or -1 if there is none.

indexOfSecondWhiteSpace

public static int indexOfSecondWhiteSpace(StringBuilder buffer)
Returns the index of the second white space.

Parameters:
buffer - the buffer to be analyzed.
Returns:
the index of the second white space or -1 if there is none.

indexOfFirstWhiteSpace

public static int indexOfFirstWhiteSpace(int offset,
                                         StringBuilder buffer)
Returns the index of the first white space, starting at the given offset.

Parameters:
offset - the index to start analyzing.
buffer - the buffer to be analyzed.
Returns:
the index of the second white space or -1 if there is none.

indexOfFirstWhiteSpace

public static int indexOfFirstWhiteSpace(String string)
Returns the index of the first white space.

Parameters:
string - the string to be analyzed.
Returns:
the index of the first white space or -1 if there is none.

indexOfSecondWhiteSpace

public static int indexOfSecondWhiteSpace(String string)
Returns the index of the second white space.

Parameters:
string - the string to be analyzed.
Returns:
the index of the second white space or -1 if there is none.


Copyright © 2007-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.