jme3tools.navigation
Class StringUtil

java.lang.Object
  extended by jme3tools.navigation.StringUtil

public class StringUtil
extends java.lang.Object

A collection of String utilities.


Constructor Summary
StringUtil()
           
 
Method Summary
 java.lang.String boolArrToStr(boolean[] arr)
           
 java.lang.String padNum(double num, int wholeLen, int decimalPlaces)
          Right aligns a double number with spaces for printing
 java.lang.String padNum(float num, int wholeLen, int decimalPlaces)
          Right aligns a float number with spaces for printing
 java.lang.String padNum(int num, int totalLen)
          Right aligns an integer number with spaces for printing
 java.lang.String padNum(long num, int totalLen)
          Right aligns a long number with spaces for printing
 java.lang.String padNumZero(double num, int wholeLen, int decimalPlaces)
          Right aligns a double number with zeros for printing
 java.lang.String padNumZero(float num, int wholeLen, int decimalPlaces)
          Right aligns a float number with zeros for printing
 java.lang.String padNumZero(int num, int totalLen)
          Right aligns an integer number with zeros for printing
 java.lang.String padNumZero(long num, int totalLen)
          Right aligns a long number with zeros for printing
 java.lang.String padStringRight(java.lang.String input, int wholeLen)
          Right aligns a String with zeros for printing
 java.lang.String prettyNum(double num)
          Formats a double nicely for printing: THIS DOES NOT ROUND!!!!
 java.lang.String[] splitDelimitedStr(java.lang.String str, java.lang.String delimiter)
          Splits a newline (\n) delimited string into an array of strings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtil

public StringUtil()
Method Detail

splitDelimitedStr

public java.lang.String[] splitDelimitedStr(java.lang.String str,
                                            java.lang.String delimiter)
Splits a newline (\n) delimited string into an array of strings

Parameters:
str - the string to split up
delimiter - the delimiter to use in splitting
Returns:
an array of String objects equivalent to str

padNum

public java.lang.String padNum(long num,
                               int totalLen)
Right aligns a long number with spaces for printing

Parameters:
num - the number to be aligned
totalLen - the total length of the padded string
Returns:
the padded number

padNumZero

public java.lang.String padNumZero(long num,
                                   int totalLen)
Right aligns a long number with zeros for printing

Parameters:
num - the number to be aligned
totalLen - the total length of the padded string
Returns:
the padded number

padNum

public java.lang.String padNum(int num,
                               int totalLen)
Right aligns an integer number with spaces for printing

Parameters:
num - the number to be aligned
totalLen - the total length of the padded string
Returns:
the padded number

padNumZero

public java.lang.String padNumZero(int num,
                                   int totalLen)
Right aligns an integer number with zeros for printing

Parameters:
num - the number to be aligned
totalLen - the total length of the padded string
Returns:
the padded number

padNum

public java.lang.String padNum(double num,
                               int wholeLen,
                               int decimalPlaces)
Right aligns a double number with spaces for printing

Parameters:
num - the number to be aligned
wholeLen - the total length of the padded string
Returns:
the padded number

padNumZero

public java.lang.String padNumZero(double num,
                                   int wholeLen,
                                   int decimalPlaces)
Right aligns a double number with zeros for printing

Parameters:
num - the number to be aligned
wholeLen - the total length of the padded string
Returns:
the padded number

padNum

public java.lang.String padNum(float num,
                               int wholeLen,
                               int decimalPlaces)
Right aligns a float number with spaces for printing

Parameters:
num - the number to be aligned
wholeLen - the total length of the padded string
Returns:
the padded number

padNumZero

public java.lang.String padNumZero(float num,
                                   int wholeLen,
                                   int decimalPlaces)
Right aligns a float number with zeros for printing

Parameters:
num - the number to be aligned
wholeLen - the total length of the padded string
Returns:
the padded number

padStringRight

public java.lang.String padStringRight(java.lang.String input,
                                       int wholeLen)
Right aligns a String with zeros for printing

Parameters:
input - the String to be aligned
wholeLen - the total length of the padded string
Returns:
the padded number

boolArrToStr

public java.lang.String boolArrToStr(boolean[] arr)
Parameters:
arr - a boolean array to be represented as a string
Returns:
the array as a string

prettyNum

public java.lang.String prettyNum(double num)
Formats a double nicely for printing: THIS DOES NOT ROUND!!!!

Parameters:
num - the double to be turned into a pretty string
Returns:
the pretty string