|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.util.StringLib
public class StringLib
Library of utility routines pertaining to Strings.
Method Summary | |
---|---|
static java.lang.String |
abbreviate(java.lang.String str,
java.awt.FontMetrics fm,
int width)
Abbreviate a String by simply truncating it. |
static java.lang.String |
abbreviateName(java.lang.String str,
java.awt.FontMetrics fm,
int width)
Abbreviate a String as a given name. |
static java.lang.String |
capitalizeFirstOnly(java.lang.String s)
Capitalize all letters preceded by whitespace, and lower case all other letters. |
static java.lang.String |
formatNumber(double number,
int decimalPlaces)
Format the given number as a String, including the given number of decimal places. |
static java.lang.String |
getArrayString(java.lang.Object a)
Given an array object, create a String showing the contents of the array using a "[a[0], a[1], ..., a[a.length-1]]" format. |
static java.lang.String |
getStackTrace(java.lang.Throwable t)
Get the stack trace of the given Throwable as a String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final java.lang.String getArrayString(java.lang.Object a)
a
- the array object
public static java.lang.String formatNumber(double number, int decimalPlaces)
number
- the number to formatdecimalPlaces
- the number of decimal places to include
public static java.lang.String capitalizeFirstOnly(java.lang.String s)
s
- the String to capitalize
public static java.lang.String getStackTrace(java.lang.Throwable t)
t
- the Throwable
public static java.lang.String abbreviate(java.lang.String str, java.awt.FontMetrics fm, int width)
str
- the String to abbreviatefm
- the FontMetrics for measuring the String lengthwidth
- the maximum string width, in pixels
public static java.lang.String abbreviateName(java.lang.String str, java.awt.FontMetrics fm, int width)
str
- the String to abbreviatefm
- the FontMetrics for measuring the String lengthwidth
- the maximum string width, in pixels
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |