Novell exteNd
Director 5.2 API

com.sssw.fw.util
Class EboMisc

java.lang.Object
 |
 +--com.sssw.fw.util.EboMisc

public class EboMisc
extends Object

This is a utility class for some useful String operations.


Field Summary
static Integer EIGHT
          Constant for '8' Integer.
static BigDecimal EIGHT_BD
          Constant for '8' BigDecimal.
static Double EIGHT_D
          Constant for '8' double.
static Integer FIVE
          Constant for '5' Integer.
static BigDecimal FIVE_BD
          Constant for '5' BigDecimal.
static Double FIVE_D
          Constant for '5' double.
static Integer FOUR
          Constant for '4' Integer.
static BigDecimal FOUR_BD
          Constant for '4' BigDecimal.
static Double FOUR_D
          Constant for '4' double.
static int IDX_DURATION_HOURS
          constant for hours duration index.
static int IDX_DURATION_MILLIS
          Constant for milliseconds duration index.
static int IDX_DURATION_MINUTES
          Constant for minutes duration index.
static int IDX_DURATION_SECONDS
          Constant for seconds duration index.
static String[] m_emptyStringArray
          Empty array used to return a String array of length 0
static Integer MINUS_ONE
          Constant for '-1' Integer.
static BigDecimal MINUS_ONE_BD
          Constant for '-1' BigDecimal.
static Double MINUS_ONE_D
          Constant for '-1' double.
static Integer NINE
          Constant for '9' Integer.
static BigDecimal NINE_BD
          Constant for '9' BigDecimal.
static Double NINE_D
          Constant for '9' double.
static Integer ONE
          Constant for '1' Integer.
static BigDecimal ONE_BD
          Constant for '1' BigDecimal.
static Double ONE_D
          Constant for '1' double.
static Integer SEVEN
          Constant for '7' Integer.
static BigDecimal SEVEN_BD
          Constant for '7' BigDecimal.
static Double SEVEN_D
          Constant for '7' double.
static Integer SIX
          Constant for '6' Integer.
static BigDecimal SIX_BD
          Constant for '6' BigDecimal.
static Double SIX_D
          Constant for '6' double.
static Integer TEN
          Constant for '10' Integer.
static BigDecimal TEN_BD
          Constant for '10' BigDecimal.
static Double TEN_D
          Constant for '10' double.
static Integer THREE
          Constant for '3' Integer.
static BigDecimal THREE_BD
          Constant for '3' BigDecimal.
static Double THREE_D
          Constants for '3' double.
static Integer TWO
          Constant for '2' Integer.
static BigDecimal TWO_BD
          Constant for '2' BigDecimal.
static Double TWO_D
          Constants for '2' double.
static Integer ZERO
          Constant for '0' Integer.
static BigDecimal ZERO_BD
          Constant for '0' BigDecimal.
static Double ZERO_D
          Constant for '0' double.
 
Constructor Summary
EboMisc()
           
 
Method Summary
static void addArrayElementsToVector(Vector v, Object[] array)
          Adds an object array elements to a Vector object.
static Object[] arrayConcat(Object[] ary1, Object[] ary2)
          Concatenates one object array to another and returns a newly created resulting object array.
static Object[] arrayConcat(Object[] ary1, Object[] ary2, Class componentType)
          Concatenates one object array to another and returns a newly created resulting object array.
static Vector arrayToVector(Object[] array)
          Returns a Vector object containing the elements of the given object array.
static byte[] condenseBytes(byte[] bytes)
          Condenses the byte array passed in by transforming each 2 bytes into a byte.
static boolean contains(int[] array, int x)
          Returns true if the array contains the specified int.
static boolean contains(Object[] array, Object obj)
          Returns true if the array contains the specified Object.
static void deleteDirectory(File directory)
          Invokes system operation to delete a directory.
static void dumpBytes(byte[] bytes)
          Prints the specified bytes to System.out.
static void dumpBytes(byte[] bytes, int maxLen)
          Prints the bytes from a specified byte array to System.out.
static void dumpStack(int lines)
          Prints the first n levels of the current stack trace to System.out.
static boolean emptyString(String s)
          Returns true if s is null or contains only white space
static Object[] enumToArray(Enumeration enum, Class componentType)
          Returns an array filled with the elements of the enumeration.
static int enumToArray(Enumeration enum, Object[] array)
          Copies the values of an enumeration to an array.
static ArrayList enumToArrayList(Enumeration enum)
          Copies the values of an enumeration to an ArrayList.
static int enumToVector(Enumeration enum, Vector v)
          Copies the values of an enumeration to a Vector.
static boolean equals(byte[] array1, byte[] array2)
          Compares two byte arrays.
static boolean equals(int[] array1, int[] array2)
          Compares two int arrays.
static boolean equals(Object[] array1, Object[] array2)
          Compares two object arrays.
static boolean equals(Object obj1, Object obj2)
          Compares the two objects.
static File findFile(String path, String fileName)
          Searches the paths given for the named file.
static BigDecimal getBigDecimal(int i)
          Returns the BigDecimal version of 'dec'.
static Boolean getBoolean(boolean b)
          Returns the Boolean version of 'b'.
static Double getDouble(double d)
          Returns the Double version of 'd'.
static int[] getDuration(long millis)
          Gets an int array from a millisecond with the following int values in the int array:
Hours - indexed by IDX_DURATION_HOURS Minutes - indexed by IDX_DURATION_MINUTES Seconds - indexed by IDX_DURATION_SECONDS miliseconds - indexed by IDX_DURATION_MILLIS
static String getDurationDesc(long millis, boolean skipZeros)
          Gets the duration description for a milliseconds value.
static String getHexString(byte[] bytes)
          Returns a hex digit String from the given byte array.
static String getHexString(byte[] bytes, int len)
          Returns a hex digit String from the given byte array.
static String getIndent(int indentLevel)
          Returns a String that represents an amount of indenting.
static Integer getInteger(int i)
          Returns the Integer version of 'i'.
static int getIntValue(BigDecimal dec, int defaultValue)
          Returns the defaultValue, if 'dec' is null.
static int getIntValue(Integer i, int defaultValue)
          Returns the defaultValue if 'i' is null.
static String getLimitedString(Object value, FontMetrics fm, int limit, boolean noEllipsis)
          No information available
static String getLimitedString(Object value, int limit)
          Returns the first 'limit' characters of the text, or up to the first newline, whichever comes first.
static String getLimitedString(Object value, int limit, boolean noEllipsis)
          No information available
static String getPropSummary(Map props, boolean nice)
          Gets a summary string for a set of properties.
static String getStackTrace()
          Returns a String containing the current stack trace (i.e.
static String getStackTrace(int skipLines)
          Gets the current stack trace.
static String getStackTrace(Throwable ex)
          Gets a String containing current stack trace of the specified exception.
static String getStackTrace(Throwable ex, int skipLines)
          Gets the stack trace from a throwable.
static boolean hasAncestor(EboException ex, Class ancestor)
          Checks to see if the specified EboException has the given class as its ancestor.
static int indexOf(Object[] array, Object obj)
          Returns the index of the object in the given array or -1 if not found in the array.
static boolean isEachInList(Object[] list1, Object[] list2)
          Returns true if each object (testing via equals()) in the first list is in the second list.
static boolean isEmpty(Object[] ary)
          Returns true if the given array is null or is empty.
static double log(double base, double power)
          Handy helper to supplement the a Math.log() method that only * works in base e.
static Field lookupConstant(String name)
          Returns a Field object representing a static final field.
static int lookupIntConstant(String name)
          Returns the value of a static final int field.
static String lookupStringConstant(String name)
          Returns the value of a static final String field.
static String parseFileName(String path, String seperator)
          Parses a String that contains path and filename, and returns just the filename.
static long position(byte[] array, byte[] pattern)
          Determines the byte position at which the specified byte pattern begins within the byte[] value that this byte[] object represents.
static String printValue(Object obj)
          Prints the value and type of the object.
static Object[] removeArrayElement(Object[] array, int ndx)
          Removes an element from an array, returning a newly created array with the element removed.
static boolean safeEquals(Timestamp t1, Timestamp t2)
          Safely test two Timestamps for equality.
static boolean stackContains(String s)
          Returns true if 's' is present in the current stack trace.
static boolean stackContains(String s, int lines)
          No information available
static byte[] stretchBytes(byte[] bytes, int len)
          Stretchs the byte array passed in by transforming each byte into a pair of bytes.
static Hashtable stringToHashtable(String s)
          Converts a comma-separated list into a hashtable
static int stringToInt(String s, int defaultvalue)
          Converts a string to an int.
static String stringToUTF8(String text)
          Deprecated.  
static String[] stringToUTF8(String[] textArray)
          Deprecated.  
static String toUnicodeEscapeString(String str)
          Converts a string to a unicode escaped string.
static Object[] vectorToArray(Vector v, Class componentType)
          Copies the values of a Vector to an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MINUS_ONE

public static final Integer MINUS_ONE
Constant for '-1' Integer. Usage: EboMisc.MINUS_ONE.

ZERO

public static final Integer ZERO
Constant for '0' Integer.

ONE

public static final Integer ONE
Constant for '1' Integer.

TWO

public static final Integer TWO
Constant for '2' Integer.

THREE

public static final Integer THREE
Constant for '3' Integer.

FOUR

public static final Integer FOUR
Constant for '4' Integer.

FIVE

public static final Integer FIVE
Constant for '5' Integer.

SIX

public static final Integer SIX
Constant for '6' Integer.

SEVEN

public static final Integer SEVEN
Constant for '7' Integer.

EIGHT

public static final Integer EIGHT
Constant for '8' Integer.

NINE

public static final Integer NINE
Constant for '9' Integer.

TEN

public static final Integer TEN
Constant for '10' Integer.

MINUS_ONE_D

public static final Double MINUS_ONE_D
Constant for '-1' double. Usage: EboMisc.MINUS_ONE_D

ZERO_D

public static final Double ZERO_D
Constant for '0' double.

ONE_D

public static final Double ONE_D
Constant for '1' double.

TWO_D

public static final Double TWO_D
Constants for '2' double.

THREE_D

public static final Double THREE_D
Constants for '3' double.

FOUR_D

public static final Double FOUR_D
Constant for '4' double.

FIVE_D

public static final Double FIVE_D
Constant for '5' double.

SIX_D

public static final Double SIX_D
Constant for '6' double.

SEVEN_D

public static final Double SEVEN_D
Constant for '7' double.

EIGHT_D

public static final Double EIGHT_D
Constant for '8' double.

NINE_D

public static final Double NINE_D
Constant for '9' double.

TEN_D

public static final Double TEN_D
Constant for '10' double.

MINUS_ONE_BD

public static final BigDecimal MINUS_ONE_BD
Constant for '-1' BigDecimal. Usage: EboMisc.MINUS_ONE_BD

ZERO_BD

public static final BigDecimal ZERO_BD
Constant for '0' BigDecimal.

ONE_BD

public static final BigDecimal ONE_BD
Constant for '1' BigDecimal.

TWO_BD

public static final BigDecimal TWO_BD
Constant for '2' BigDecimal.

THREE_BD

public static final BigDecimal THREE_BD
Constant for '3' BigDecimal.

FOUR_BD

public static final BigDecimal FOUR_BD
Constant for '4' BigDecimal.

FIVE_BD

public static final BigDecimal FIVE_BD
Constant for '5' BigDecimal.

SIX_BD

public static final BigDecimal SIX_BD
Constant for '6' BigDecimal.

SEVEN_BD

public static final BigDecimal SEVEN_BD
Constant for '7' BigDecimal.

EIGHT_BD

public static final BigDecimal EIGHT_BD
Constant for '8' BigDecimal.

NINE_BD

public static final BigDecimal NINE_BD
Constant for '9' BigDecimal.

TEN_BD

public static final BigDecimal TEN_BD
Constant for '10' BigDecimal.

m_emptyStringArray

public static final String[] m_emptyStringArray
Empty array used to return a String array of length 0

IDX_DURATION_HOURS

public static final int IDX_DURATION_HOURS
constant for hours duration index.

IDX_DURATION_MINUTES

public static final int IDX_DURATION_MINUTES
Constant for minutes duration index.

IDX_DURATION_SECONDS

public static final int IDX_DURATION_SECONDS
Constant for seconds duration index.

IDX_DURATION_MILLIS

public static final int IDX_DURATION_MILLIS
Constant for milliseconds duration index.
Constructor Detail

EboMisc

public EboMisc()
Method Detail

getBoolean

public static final Boolean getBoolean(boolean b)
Returns the Boolean version of 'b'.
(either Boolean.TRUE or Boolean.FALSE)

getInteger

public static final Integer getInteger(int i)
Returns the Integer version of 'i'.
(either ZERO, ONE, ..., or new Integer(i))

getDouble

public static final Double getDouble(double d)
Returns the Double version of 'd'.
(either ZERO, ONE, ..., or new Double(d))

getBigDecimal

public static final BigDecimal getBigDecimal(int i)
Returns the BigDecimal version of 'dec'.
(either ZERO_BD, ONE_BD, or new BigDecimal(d))

getIntValue

public static final int getIntValue(Integer i,
                                    int defaultValue)
Returns the defaultValue if 'i' is null. Otherwise returns the int value of 'i'.

getIntValue

public static final int getIntValue(BigDecimal dec,
                                    int defaultValue)
Returns the defaultValue, if 'dec' is null. Otherwise return the int value of 'dec'.

getLimitedString

public static String getLimitedString(Object value,
                                      int limit)
Returns the first 'limit' characters of the text, or up to the first newline, whichever comes first. For example, getLimitedString("hi there", 4) == "hi t..." Designed for displaying representative text to the user in the property inspector.

getLimitedString

public static String getLimitedString(Object value,
                                      int limit,
                                      boolean noEllipsis)
No information available

getLimitedString

public static String getLimitedString(Object value,
                                      FontMetrics fm,
                                      int limit,
                                      boolean noEllipsis)
No information available

stringToInt

public static int stringToInt(String s,
                              int defaultvalue)
Converts a string to an int. This is a fast, non-throwing string-to-integer conversion which is useful when failure to convert should result in a default value.
Parameters:
s - a string to be converted to int.
defaultvalue - a default value if the input string cannot be converted.
Returns:
an int which is either converted from the input string or the default value if the conversion failed.

equals

public static boolean equals(Object obj1,
                             Object obj2)
Compares the two objects. It returns true if ANY of the following are true:

equals

public static boolean equals(int[] array1,
                             int[] array2)
Compares two int arrays. It returns true if the contents of the arrays are ==.

equals

public static boolean equals(byte[] array1,
                             byte[] array2)
Compares two byte arrays. It returns true if the contents of the arrays are ==.

equals

public static boolean equals(Object[] array1,
                             Object[] array2)
Compares two object arrays. It returns true if the contents of the arrays are EboMisc.equal()

arrayConcat

public static Object[] arrayConcat(Object[] ary1,
                                   Object[] ary2)
Concatenates one object array to another and returns a newly created resulting object array.

* Note: the component type is determined by the component type of the * first array. If the component type must be of some base class * common to each, then use the form of arrayConcat that takes * the component type as an arg.

Parameters:
ary1 - the first array. This will be first in the result
ary2 - the second array. This will appear after the first in the result.
Returns:
a new object array with the first array concatenated with the second.

arrayConcat

public static Object[] arrayConcat(Object[] ary1,
                                   Object[] ary2,
                                   Class componentType)
Concatenates one object array to another and returns a newly created resulting object array.
Parameters:
ary1 - the first array. This will be first in the result
ary2 - the second array. This will appear after the first in the result.
componentType - the component type of the resulting array.
Returns:
a new array with the first array concatenated with the second.

removeArrayElement

public static Object[] removeArrayElement(Object[] array,
                                          int ndx)
Removes an element from an array, returning a newly created array with the element removed.
Parameters:
array - the array to remove an element from
ndx - the index of the object in the array to remove. If the ndx is out of bounds then return the original array.

arrayToVector

public static Vector arrayToVector(Object[] array)
Returns a Vector object containing the elements of the given object array.
Parameters:
array - an object array whose elements will be added to the vector.
Returns:
a Vector object containing the elements of the given object array.

addArrayElementsToVector

public static void addArrayElementsToVector(Vector v,
                                            Object[] array)
Adds an object array elements to a Vector object.
Parameters:
v - a Vector object to add the elements to
array - an object array whose elements will be added to the vector.

vectorToArray

public static Object[] vectorToArray(Vector v,
                                     Class componentType)
Copies the values of a Vector to an array.
Parameters:
vector - a Vector object whose elements are to be copied into an object array.
componentType - the class of the type of element for the array. An array of this type class will be created.
Returns:
the object array containing the elements of the Vector object or an empty array if the Vector object is empty.

enumToArray

public static Object[] enumToArray(Enumeration enum,
                                   Class componentType)
Returns an array filled with the elements of the enumeration. Assumes the enumeration is a homogeneous collection of the given type. * @param enum the enumeration * @param componentType the class of the type of element for the array. * An array of this type class will be created. * @return an array filled with the elements of the enumeration.

enumToArray

public static int enumToArray(Enumeration enum,
                              Object[] array)
Copies the values of an enumeration to an array.
Parameters:
enum - the enumeration
array - the array to copy the values to. Note that this code assumes * that the array is big enough to house the number of elements in the enumeration.
Returns:
the number of elements copied.

enumToVector

public static int enumToVector(Enumeration enum,
                               Vector v)
Copies the values of an enumeration to a Vector.
Parameters:
enum - the enumeration
v - the vector to copy the values to.
Returns:
the number of elements copied.

enumToArrayList

public static ArrayList enumToArrayList(Enumeration enum)
Copies the values of an enumeration to an ArrayList.
Parameters:
enum - the enumeration
Returns:
the ArrayList

position

public static long position(byte[] array,
                            byte[] pattern)
Determines the byte position at which the specified byte pattern begins within the byte[] value that this byte[] object represents.
Parameters:
pattern - the byte array for which to search
Returns:
the position at which the pattern appears (relative one), else -1.

contains

public static boolean contains(Object[] array,
                               Object obj)
Returns true if the array contains the specified Object. Uses EboMisc.equals() for comparison.

indexOf

public static int indexOf(Object[] array,
                          Object obj)
Returns the index of the object in the given array or -1 if not found in the array. Uses EboMisc.equals() for comparison.

contains

public static boolean contains(int[] array,
                               int x)
Returns true if the array contains the specified int.

isEachInList

public static boolean isEachInList(Object[] list1,
                                   Object[] list2)
Returns true if each object (testing via equals()) in the first list is in the second list.
Parameters:
list1 - the fist object array
list2 - the second object array
Returns:
true if each object in the first list is in the second list, false otherwise.

isEmpty

public static boolean isEmpty(Object[] ary)
Returns true if the given array is null or is empty.
Parameters:
ary - an object array to test
Returns:
true if the given array is null or is empty.

emptyString

public static boolean emptyString(String s)
Returns true if s is null or contains only white space
See Also:
EboStringMisc.isEmpty

getIndent

public static final String getIndent(int indentLevel)
Returns a String that represents an amount of indenting. Used by testing code to format test output.

stringToHashtable

public static Hashtable stringToHashtable(String s)
Converts a comma-separated list into a hashtable
Parameters:
s - a String.
Returns:
a Hashtable with the Strings parsed from comma-seprated list.

log

public static double log(double base,
                         double power)
Handy helper to supplement the a Math.log() method that only * works in base e.

getHexString

public static String getHexString(byte[] bytes)
Returns a hex digit String from the given byte array.
Parameters:
bytes - a byte array
Returns:
a hex digit string.

getHexString

public static String getHexString(byte[] bytes,
                                  int len)
Returns a hex digit String from the given byte array.
Parameters:
bytes - a byte array.
len - the length of the byte array
Returns:
a hex digit String.

stretchBytes

public static byte[] stretchBytes(byte[] bytes,
                                  int len)
Stretchs the byte array passed in by transforming each byte into a pair of bytes. The new byte pair will use only the low nibble to hold the original byte value. The low nibble in the first byte pair is the low nibble in the original and the low nibble in the second byte pair is the high nibble.
Parameters:
bytes - byte array to stretch
len - the length of the new array
Returns:
new stretched byte array

condenseBytes

public static byte[] condenseBytes(byte[] bytes)
Condenses the byte array passed in by transforming each 2 bytes into a byte. The new byte will contain the low nibble from the first byte pair and the low nibble from the second byte pair as the high nibble in the condensed byte.
Parameters:
bytes - byte array to condense
Returns:
a new condensed byte array

dumpBytes

public static void dumpBytes(byte[] bytes)
Prints the specified bytes to System.out. Any control characters are displayed as dots. Output is wrapped to 72 characters.

dumpBytes

public static void dumpBytes(byte[] bytes,
                             int maxLen)
Prints the bytes from a specified byte array to System.out.
Parameters:
bytes - a byte array.
maxLen - a maximum length of the byte array.

printValue

public static String printValue(Object obj)
Prints the value and type of the object. For example:

dumpStack

public static void dumpStack(int lines)
Prints the first n levels of the current stack trace to System.out. We also get rid of the first 3 characters of every line, which are "\tat", so the line is less likely to wrap.

stackContains

public static boolean stackContains(String s)
Returns true if 's' is present in the current stack trace. At line of the stack trace can look like this (under MSVM with +vst): at com/sssw/des/bean/JarLoader.loadJar (JarLoader.java:140) so 's' should be something like "JarLoader.loadJar"

stackContains

public static boolean stackContains(String s,
                                    int lines)
No information available

getStackTrace

public static String getStackTrace()
Returns a String containing the current stack trace (i.e. where we currently are in the program).

getStackTrace

public static String getStackTrace(Throwable ex)
Gets a String containing current stack trace of the specified exception.
Parameters:
ex - a throwable object.

getStackTrace

public static String getStackTrace(int skipLines)
Gets the current stack trace. This is a fake way to display the current stack trace.
Parameters:
sipLines - a specified number of lines to be skiped for the stack trace.
Returns:
the stack trace string.

getStackTrace

public static String getStackTrace(Throwable ex,
                                   int skipLines)
Gets the stack trace from a throwable.
Parameters:
ex - a throwable object.
skipLines - an int value to indicate how many lines to skip.
Returns:
the stack trace String.

lookupIntConstant

public static int lookupIntConstant(String name)
                             throws Exception
Returns the value of a static final int field. 'name' is the name of the field, e.g. "com.sssw.rt.form.PvFormConstants.TYPE_PUSH"
Parameters:
name - a string to be searched.

lookupStringConstant

public static String lookupStringConstant(String name)
                                   throws Exception
Returns the value of a static final String field. 'name' is the name of the field, e.g. "com.sssw.rt.util.MetaData.META_NAME"
Parameters:
name - a name to be searched.
Returns:
the String field.

lookupConstant

public static Field lookupConstant(String name)
                            throws Exception
Returns a Field object representing a static final field. 'name' is the name of the field, e.g. "com.sssw.rt.util.MetaData.META_NAME"
Parameters:
name - a name to be searched.
Returns:
a Field object.

hasAncestor

public static boolean hasAncestor(EboException ex,
                                  Class ancestor)
Checks to see if the specified EboException has the given class as its ancestor.

e.g.: boolean yes = EboMisc.hasAncestor(agoex, EboDataException.class);

Returns:
true if ancestor is somewhere in the class hierarchy that ex is a subclass of, false otherwise

findFile

public static File findFile(String path,
                            String fileName)
Searches the paths given for the named file. Returns a File.
Parameters:
path - a specified path where to locate a file
filename - a file to be located.
Returns:
a File object corresponding to the first path that contains the given file or null if the file is not found. The directories in the path string are assumed to be separated by the platform specific path separator character.

stringToUTF8

public static String stringToUTF8(String text)
Deprecated.  

Converts a String into a UTF8 String
Parameters:
text - a string to be converted
Returns:
a converted string in UTF8 format.

stringToUTF8

public static String[] stringToUTF8(String[] textArray)
Deprecated.  

Converts a string array to UTF8 format.
Returns:
the converted string array in UTF8 format.

toUnicodeEscapeString

public static String toUnicodeEscapeString(String str)
Converts a string to a unicode escaped string.
Parameters:
str - a string to be converted.
Returns:
a unicode escaped string. (in the form of ?)

deleteDirectory

public static void deleteDirectory(File directory)
Invokes system operation to delete a directory.

parseFileName

public static String parseFileName(String path,
                                   String seperator)
Parses a String that contains path and filename, and returns just the filename.
Parameters:
path - a full path of a file name.
seperator - a seperator
Returns:
the filename split from the full path name.

safeEquals

public static boolean safeEquals(Timestamp t1,
                                 Timestamp t2)
Safely test two Timestamps for equality. The passed in Timestamps may be null.
Parameters:
t1 - the first Timestamp
t2 - the second Timestamp

getPropSummary

public static String getPropSummary(Map props,
                                    boolean nice)
Gets a summary string for a set of properties.
Parameters:
props - the properties
nice - if true, use tabs and newlines to format the output
Returns:
the summary string

getDurationDesc

public static String getDurationDesc(long millis,
                                     boolean skipZeros)
Gets the duration description for a milliseconds value.
Parameters:
millis - a milliseonds value
skipZeros - if true skips zeros
Returns:
a String that contains the description of hours, minutes, seconds, and miniseconds in a readable form.

getDuration

public static int[] getDuration(long millis)
Gets an int array from a millisecond with the following int values in the int array:

Novell exteNd
Director 5.2 API