|
deegree 2.4 (2010/11/11 10:47 build-27-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deegree.framework.util.StringTools
public class StringTools
this is a collection of some methods that extends the functionality of the sun-java string class.
Constructor Summary | |
---|---|
StringTools()
|
Method Summary | |
---|---|
static String |
arrayToString(double[] s,
char delimiter)
transforms a double array to one string. the array fields are separated by the submitted delimiter: |
static String |
arrayToString(float[] s,
char delimiter)
transforms a float array to one string. the array fields are separated by the submitted delimiter: |
static String |
arrayToString(int[] s,
char delimiter)
transforms a int array to one string. the array fields are separated by the submitted delimiter: |
static String |
arrayToString(String[] s,
char delimiter)
transforms a string array to one string. the array fields are separated by the submitted delimiter: |
static String |
concat(int size,
Object... objects)
concatenates an array of strings using a |
static boolean |
contains(String[] target,
String value)
checks if the submitted array contains the string value |
static int |
countString(String target,
String token)
countString count the occurrences of token into target |
static String[] |
deleteDoubles(String[] s)
deletes all double entries from the submitted array |
static String |
extractString(String target,
String startDel,
String endDel,
boolean delStart,
boolean delEnd)
extract a string contained between startDel and endDel, you can remove the delimiters if set true the parameters delStart and delEnd |
static String[] |
extractStrings(String target,
String startString,
String endString)
Extract all the strings that begin with "start" and end with "end" and store it into an array of String |
static String |
listToString(List<?> s,
char delimiter)
transforms a list to one string. the array fields are separated by the submitted delimiter: |
static String |
normalizeString(String source,
String locale)
The passed string gets normalized along the rules for the given locale as they are set in the file ". |
static void |
printStacktrace()
prints current stactrace |
static String[] |
removeFromArray(String[] target,
String s)
removes all fields from the array that equals s |
static String |
replace(String target,
String from,
String to,
boolean all)
replaces occurences of a string fragment within a string by a new string. |
static String |
stackTraceToString(StackTraceElement[] se)
transforms an array of StackTraceElements into a String |
static String |
stackTraceToString(Throwable e)
Get the message and the class, as well as the stack trace of the passed Throwable and transforms it into a String |
static String[] |
toArray(String s,
String delimiter,
boolean deleteDoubles)
parse a string and return its tokens as array |
static double[] |
toArrayDouble(String s,
String delimiter)
convert the array of string like [(x1,y1),(x2,y2)...] into an array of double [x1,y1,x2,y2...] |
static float[] |
toArrayFloat(String s,
String delimiter)
convert the array of string like [(x1,y1),(x2,y2)...] into an array of float values [x1,y1,x2,y2...] |
static List<String> |
toList(String s,
String delimiter,
boolean deleteDoubles)
parse a string and return its tokens as typed List. empty fields will be removed from the list. |
static String |
validateString(String s,
String mark)
clears the begin and end of a string from the strings submitted |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringTools()
Method Detail |
---|
public static String concat(int size, Object... objects)
size
- estimated size of the target stringobjects
- toString() will be called for each object to append it to the result string
StringBuffer
public static String replace(String target, String from, String to, boolean all)
target
- is the original stringfrom
- is the string to be replacedto
- is the string which will used to replaceall
- if it's true all occurences of the string to be replaced will be replaced. else only the first
occurence will be replaced.
public static String[] toArray(String s, String delimiter, boolean deleteDoubles)
s
- string to parsedelimiter
- delimiter that marks the end of a tokendeleteDoubles
- if it's true all string that are already within the resulting array will be deleted, so that there
will only be one copy of them.
public static List<String> toList(String s, String delimiter, boolean deleteDoubles)
s
- string to parsedelimiter
- delimiter that marks the end of a tokendeleteDoubles
- if it's true all string that are already within the resulting array will be deleted, so that there
will only be one copy of them.
public static String arrayToString(String[] s, char delimiter)
s
- stringarray to transformdelimiter
-
public static String listToString(List<?> s, char delimiter)
s
- stringarray to transformdelimiter
-
public static String arrayToString(double[] s, char delimiter)
s
- string array to transformdelimiter
-
public static String arrayToString(float[] s, char delimiter)
s
- float array to transformdelimiter
-
public static String arrayToString(int[] s, char delimiter)
s
- stringarray to transformdelimiter
-
public static String validateString(String s, String mark)
s
- string to validatemark
- string to remove from begin and end of s
public static String[] deleteDoubles(String[] s)
s
- to remove the doubles from
public static String[] removeFromArray(String[] target, String s)
s
target
- array where to remove the submitted strings
- string to remove
public static boolean contains(String[] target, String value)
value
target
- array to check if it contains value
value
- string to check if it within the array
public static double[] toArrayDouble(String s, String delimiter)
s
- delimiter
-
public static float[] toArrayFloat(String s, String delimiter)
s
- delimiter
-
public static void printStacktrace()
public static String stackTraceToString(StackTraceElement[] se)
se
- to put to String
public static String stackTraceToString(Throwable e)
e
- to get information from
public static int countString(String target, String token)
target
- token
-
public static String[] extractStrings(String target, String startString, String endString)
target
- startString
- endString
-
null
if no strings were found!!public static String extractString(String target, String startDel, String endDel, boolean delStart, boolean delEnd)
target
- to extract fromstartDel
- to remove from the startendDel
- string to remove from the enddelStart
- true if the start should be removeddelEnd
- true if the end should be removed
public static String normalizeString(String source, String locale) throws IOException, SAXException, XMLParsingException
source
- the String to normalizelocale
- the locale language defining the rules to choose, e.g. "de"
IOException
SAXException
XMLParsingException
|
deegree 2.4 (2010/11/11 10:47 build-27-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org