unlekker.util
Class Str

java.lang.Object
  extended by unlekker.util.Str

public class Str
extends java.lang.Object

Utility class for manipulating and generating text.

Author:
Marius Watz

Field Summary
static java.lang.StringBuffer buf
           
 
Constructor Summary
Str()
           
 
Method Summary
static java.lang.String getDateStr(java.util.Calendar date)
           
static java.lang.String getDateStrConcise()
           
static java.lang.String getDateStrConcise(java.util.Calendar date)
           
static java.lang.String getTimeStr()
           
static java.lang.String getTimeStr(java.util.Calendar date)
           
static java.lang.String getTimeStrConcise()
           
static java.lang.String getTimeStrConcise(java.util.Calendar date)
           
static java.lang.String numStr(double num)
          Returns a string containing the number "num", shortened to maximum 3 decimal points.
static java.lang.String padNumStr(java.lang.String prefix, int num, int numlen)
          Pads the number string given by the number "num" with zero characters if it is shorter than "numlen".
static java.lang.String shorten(java.lang.String s)
          Shortens the string "s" to a length of 70 characters.
static java.lang.String shorten(java.lang.String s, int len)
          Shortens the string "s" to a length of "len" characters.
static java.lang.String shortFilename(java.lang.String name)
           
static java.lang.String timeStr(long t)
           
static java.lang.String wrapText(java.lang.String s, int len)
           
static java.lang.String[] wrapTextArray(java.lang.String s, int len)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buf

public static java.lang.StringBuffer buf
Constructor Detail

Str

public Str()
Method Detail

shorten

public static java.lang.String shorten(java.lang.String s,
                                       int len)
Shortens the string "s" to a length of "len" characters.


shorten

public static java.lang.String shorten(java.lang.String s)
Shortens the string "s" to a length of 70 characters.


padNumStr

public static java.lang.String padNumStr(java.lang.String prefix,
                                         int num,
                                         int numlen)
Pads the number string given by the number "num" with zero characters if it is shorter than "numlen". If "prefix" is not null, it will be prefixed to the result.


shortFilename

public static java.lang.String shortFilename(java.lang.String name)

wrapTextArray

public static java.lang.String[] wrapTextArray(java.lang.String s,
                                               int len)

numStr

public static java.lang.String numStr(double num)
Returns a string containing the number "num", shortened to maximum 3 decimal points.


wrapText

public static java.lang.String wrapText(java.lang.String s,
                                        int len)

timeStr

public static java.lang.String timeStr(long t)

getDateStr

public static java.lang.String getDateStr(java.util.Calendar date)

getDateStrConcise

public static java.lang.String getDateStrConcise()

getDateStrConcise

public static java.lang.String getDateStrConcise(java.util.Calendar date)

getTimeStr

public static java.lang.String getTimeStr()

getTimeStr

public static java.lang.String getTimeStr(java.util.Calendar date)

getTimeStrConcise

public static java.lang.String getTimeStrConcise()

getTimeStrConcise

public static java.lang.String getTimeStrConcise(java.util.Calendar date)