de.uplanet.lucy.util
Class TextUtil

java.lang.Object
  extended by de.uplanet.lucy.util.TextUtil

@Scriptable
public final class TextUtil
extends java.lang.Object

Version:
$Revision: 86609 $

Method Summary
static java.lang.String listToString(java.util.Collection<java.lang.String> p_list)
          Serializes a list of strings to a string using "|" as delimiter and "0" as escape character.
static java.lang.String listToString(java.util.Collection<java.lang.String> p_list, java.lang.String p_strDel, java.lang.String p_strEsc)
          Serializes a list of strings to a string.
static java.util.LinkedList<java.lang.String> stringToList(java.lang.String p_str)
          Deserialize a list of strings that was previously serialized with "|" as delimiter and "0" as escape character.
static java.util.LinkedList<java.lang.String> stringToList(java.lang.String p_str, java.lang.String p_strDel, java.lang.String p_strEsc)
          Deserialize an array that was previously serialized using TextUtil#listToString(Collection, String, String).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

listToString

public static java.lang.String listToString(java.util.Collection<java.lang.String> p_list)
Serializes a list of strings to a string using "|" as delimiter and "0" as escape character.

Note that stringToList and listToString are inverse functions.

Parameters:
p_list - The list to serialize.
Returns:
The serialized array list.

listToString

public static java.lang.String listToString(java.util.Collection<java.lang.String> p_list,
                                            java.lang.String p_strDel,
                                            java.lang.String p_strEsc)
Serializes a list of strings to a string.

Note that stringToList and listToString are inverse functions.

Parameters:
p_list - The list to serialize.
p_strDel - The delimiter sequence to use.
p_strEsc - The escape sequence to use.
Returns:
The serialized array list.

stringToList

public static java.util.LinkedList<java.lang.String> stringToList(java.lang.String p_str)
Deserialize a list of strings that was previously serialized with "|" as delimiter and "0" as escape character.

Note that stringToList and listToString are inverse functions.

Parameters:
p_str - The string containing the serialized array.
Returns:
The deserialized array, or an empty list, if the given input is null, or empty.

stringToList

public static java.util.LinkedList<java.lang.String> stringToList(java.lang.String p_str,
                                                                  java.lang.String p_strDel,
                                                                  java.lang.String p_strEsc)
Deserialize an array that was previously serialized using TextUtil#listToString(Collection, String, String).

Note that stringToList and listToString are inverse functions.

Parameters:
p_str - The string containing the serialized array.
p_strDel - The delimiter sequence to use.
p_strEsc - The escape sequence to use.
Returns:
The deserialized array, or an empty list, if the given input is null, or empty.
To Do:
Improve performance and get rid of references to StringHelper.


Last updated: 2011-08-11 10-04
Copyright © 2000-2011 United Planet. All Rights Reserved.