org.jfree.report.util
Class StringUtil

java.lang.Object
  extended byorg.jfree.report.util.StringUtil

public final class StringUtil
extends java.lang.Object

String utility functions.

Author:
Thomas Morgner

Method Summary
static boolean endsWithIgnoreCase(java.lang.String base, java.lang.String end)
          Helper functions to query a strings end portion.
static boolean parseBoolean(java.lang.String attribute, boolean defaultValue)
          Parses the given string into a boolean value.
static int parseInt(java.lang.String value, int defaultValue)
          Parses the given string and returns the parsed integer value or the given default if the parsing failed.
static boolean startsWithIgnoreCase(java.lang.String base, java.lang.String start)
          Helper functions to query a strings start portion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

startsWithIgnoreCase

public static boolean startsWithIgnoreCase(java.lang.String base,
                                           java.lang.String start)
Helper functions to query a strings start portion. The comparison is case insensitive.

Parameters:
base - the base string.
start - the starting text.
Returns:
true, if the string starts with the given starting text.

endsWithIgnoreCase

public static boolean endsWithIgnoreCase(java.lang.String base,
                                         java.lang.String end)
Helper functions to query a strings end portion. The comparison is case insensitive.

Parameters:
base - the base string.
end - the ending text.
Returns:
true, if the string ends with the given ending text.

parseInt

public static int parseInt(java.lang.String value,
                           int defaultValue)
Parses the given string and returns the parsed integer value or the given default if the parsing failed.

Parameters:
value - the to be parsed string
defaultValue - the default value
Returns:
the parsed string.

parseBoolean

public static boolean parseBoolean(java.lang.String attribute,
                                   boolean defaultValue)
Parses the given string into a boolean value. This returns true, if the string's value is "true".

Parameters:
attribute - the string that should be parsed.
defaultValue - the default value, in case the string is null.
Returns:
the parsed value.