com.metsci.glimpse.util
Class StringUtils

java.lang.Object
  extended by com.metsci.glimpse.util.StringUtils

public final class StringUtils
extends java.lang.Object

Author:
hogye

Field Summary
static java.lang.String degreeSymbol
           
static java.lang.String lowercaseSigma
           
static java.lang.String superscriptTwo
           
static java.lang.String whiteBox
           
static java.lang.String whiteCircle
           
static java.lang.String whiteDiamond
           
 
Method Summary
static java.lang.String decimalFormat(double d, int numDecimalPlaces)
           
static java.lang.String getFilenameExtension(java.lang.String filename)
          Get the extension of a file.
static java.lang.String getStackTraceString(java.lang.Throwable t)
          Returns the stack trace of an exception in the form of a string.
static java.lang.String join(java.lang.String separator, java.lang.String... strings)
          Joins strings with given separator between each pair.
static java.lang.String removeFilenameExtension(java.lang.String filename)
          Removes the filename extension from a filename, if there is one.
static java.lang.String repeat(java.lang.String val, int rep)
          Repeats a given string a specified number of times.
static java.lang.String[] split(java.lang.String s, char delimiter)
          This method splits a String into an array of values, the values being delimited with the given character.
static java.lang.String toString(double[] a)
           
static java.lang.String toString(int[] a)
           
static java.lang.String toString(long[] a)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

degreeSymbol

public static final java.lang.String degreeSymbol
See Also:
Constant Field Values

superscriptTwo

public static final java.lang.String superscriptTwo
See Also:
Constant Field Values

lowercaseSigma

public static final java.lang.String lowercaseSigma
See Also:
Constant Field Values

whiteBox

public static final java.lang.String whiteBox
See Also:
Constant Field Values

whiteCircle

public static final java.lang.String whiteCircle
See Also:
Constant Field Values

whiteDiamond

public static final java.lang.String whiteDiamond
See Also:
Constant Field Values
Method Detail

split

public static java.lang.String[] split(java.lang.String s,
                                       char delimiter)
This method splits a String into an array of values, the values being delimited with the given character. For example splitIntoArray("one~two~three", '~') returns {"one", "two", "three" }. Consecutive delimiters are correctly handled, for example splitIntoArray("first~~last", '~') returns {"first", "", "last" }

Parameters:
s - the String to be split. If s is null then the returned array is also null.
delimiter - the delimiter character used to separate values.
See Also:
String.split(String)

join

public static java.lang.String join(java.lang.String separator,
                                    java.lang.String... strings)
Joins strings with given separator between each pair. For instance, join(", ", "one", "two") returns the String "one, two".


removeFilenameExtension

public static java.lang.String removeFilenameExtension(java.lang.String filename)
Removes the filename extension from a filename, if there is one. The character that separates the filename base from its extension is assumed to be the period ('.').

For example "foo.txt" gives "foo", while "foo.java.txt" gives "foo.java".


repeat

public static java.lang.String repeat(java.lang.String val,
                                      int rep)
Repeats a given string a specified number of times.


toString

public static java.lang.String toString(int[] a)

toString

public static java.lang.String toString(long[] a)

toString

public static java.lang.String toString(double[] a)

getFilenameExtension

public static java.lang.String getFilenameExtension(java.lang.String filename)
Get the extension of a file.


getStackTraceString

public static java.lang.String getStackTraceString(java.lang.Throwable t)
Returns the stack trace of an exception in the form of a string.


decimalFormat

public static java.lang.String decimalFormat(double d,
                                             int numDecimalPlaces)


Copyright © 2012 Metron, Inc.. All Rights Reserved.