jp.go.aist.rtm.RTC.util
Class StringUtil

java.lang.Object
  extended by jp.go.aist.rtm.RTC.util.StringUtil

public class StringUtil
extends java.lang.Object


Constructor Summary
StringUtil()
           
 
Method Summary
static java.lang.String escape(java.lang.String str)
           Escapes in the character string.
static java.lang.String flatten(java.util.Set sv)
           generates CSV from the given character string list.
static java.lang.String flatten(java.util.Vector<java.lang.String> sv)
           Creates CSV from the given character string list.
static boolean includes(java.util.Vector<java.lang.String> list, java.lang.String value, boolean ignore_case)
           Checks whether the specified character string is included in the list of the specified character string.
static boolean isAbsolutePath(java.lang.String str)
           Judges whether it is an absolute path the given String.
static boolean isEscaped(java.lang.String str, int pos)
           Judges whether to be escaped.
static java.lang.String normalize(java.lang.String str)
           Erase the head/tail blank and replace upper case to lower case
static java.util.Vector<java.lang.String> split(java.lang.String input, java.lang.String delimiter)
           divides the character string by the division character.
static boolean toBool(java.lang.String target, java.lang.String yes, java.lang.String no, boolean default_value)
           Cconverts the given character string into bool value.
static java.lang.String unescape(java.lang.String str)
           Unescapes in the character string.
static java.util.Vector<java.lang.String> unique_sv(java.lang.String[] sv)
           Deletes repetition from the given character string list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtil

public StringUtil()
Method Detail

isEscaped

public static boolean isEscaped(java.lang.String str,
                                int pos)
Judges whether to be escaped.

Parameters:
str - Character string including character that judges whether to be escaped
pos - Position of character that judges whether to be escaped
Returns:
The character string is true if escaped.

escape

public static java.lang.String escape(java.lang.String str)
Escapes in the character string.

Converts the following character into the escape sequence.

Processes neither a single quart nor a double quart.

Parameters:
str - Character string of escape processing object
Returns:
Character string after escape is processed

unescape

public static java.lang.String unescape(java.lang.String str)
Unescapes in the character string.

Converts the following escape sequence into the character.

Note the point that doesn't become it in a complete inversion of espace().

Parameters:
str - Character string where to be unescaped
Returns:
Character string after it unescapes

toBool

public static boolean toBool(java.lang.String target,
                             java.lang.String yes,
                             java.lang.String no,
                             boolean default_value)
Cconverts the given character string into bool value.

Erase the head/tail blank and replace upper case to lower case

Parameters:
target - Strig for judgment
yes - Charactor string that expresses true.
no - Charactor string that expresses false.
default_value - default
Returns:
Comparative result

unique_sv

public static java.util.Vector<java.lang.String> unique_sv(java.lang.String[] sv)
Deletes repetition from the given character string list.

Parameters:
sv - Character string list
Returns:
List of character string of result

flatten

public static java.lang.String flatten(java.util.Vector<java.lang.String> sv)
Creates CSV from the given character string list.

Parameters:
sv - Character string list to be converted
Returns:
Character string of conversion result

flatten

public static java.lang.String flatten(java.util.Set sv)
generates CSV from the given character string list.

Parameters:
sv - Character string list to be converted
Returns:
Character string of conversion result

split

public static java.util.Vector<java.lang.String> split(java.lang.String input,
                                                       java.lang.String delimiter)
divides the character string by the division character.

Parameters:
input - Character string to be divided
delimiter - Delimiter
Returns:
Result

normalize

public static java.lang.String normalize(java.lang.String str)
Erase the head/tail blank and replace upper case to lower case

Parameters:
str - String
Returns:
Result

includes

public static boolean includes(java.util.Vector<java.lang.String> list,
                               java.lang.String value,
                               boolean ignore_case)
Checks whether the specified character string is included in the list of the specified character string.

Parameters:
list - the list of the string
value - String
ignore_case - Capital letters and small letters flag
Returns:
It is true if included.

isAbsolutePath

public static boolean isAbsolutePath(java.lang.String str)
Judges whether it is an absolute path the given String.

Parameters:
str - String
Returns:
an absolute path is true