com.jamonapi.utils
Class Misc

java.lang.Object
  extended by com.jamonapi.utils.Misc

public class Misc
extends java.lang.Object


Constructor Summary
Misc()
           
 
Method Summary
static void addTo(java.util.Collection coll, java.lang.Object objToAdd)
          Note if the passed object is a Colleciton itself or an Object[] it will be expanded
static java.lang.Object[][] allocateArray(int rows, int cols)
           
static java.util.Map createCaseInsensitiveMap()
          Create a case insenstive Tree Map.
static void disp(java.lang.Object[][] data)
           
static java.lang.String getAsString(java.lang.Object obj)
           
static java.lang.String getClassName(java.lang.Object object)
          Returns an Objects ClassName minus the package name Sample Call: String className=Misc.getClassName("My Object"); // returns "String"
static java.lang.String getDayOfWeek()
          Get the day of week for today.
static java.lang.String getDayOfWeek(java.util.Date date)
          Return the day of week from the passed in Date.
static java.lang.String getExceptionTrace(java.lang.Throwable exception)
           
static java.lang.String getFormattedDate(java.lang.String format, java.util.Date date)
          Formats the passed in date with the passed in date format String.
static java.lang.String getFormattedDateNow(java.lang.String format)
          Formats todays date with the passed in date format String.
static java.lang.String getMonth()
          Return the 2 digit month of todays date
static java.lang.String getMonth(java.util.Date date)
          Get the month out of the passed in Date.
static java.lang.String getShortDate()
          Get the short date for Today.
static java.lang.String getShortDate(java.util.Date date)
          Get the short date for the passed in day.
static void isObjectString(java.lang.Object arg)
           
static void main(java.lang.String[] args)
           
static java.lang.Object[][] sort(java.lang.Object[][] array, int sortCol, java.lang.String sortOrder)
          Sort a 2 dimensional array based on 1 columns data in either ascending or descending order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Misc

public Misc()
Method Detail

getClassName

public static java.lang.String getClassName(java.lang.Object object)
Returns an Objects ClassName minus the package name Sample Call: String className=Misc.getClassName("My Object"); // returns "String"


getExceptionTrace

public static java.lang.String getExceptionTrace(java.lang.Throwable exception)

addTo

public static void addTo(java.util.Collection coll,
                         java.lang.Object objToAdd)
Note if the passed object is a Colleciton itself or an Object[] it will be expanded


getAsString

public static java.lang.String getAsString(java.lang.Object obj)

isObjectString

public static void isObjectString(java.lang.Object arg)

sort

public static java.lang.Object[][] sort(java.lang.Object[][] array,
                                        int sortCol,
                                        java.lang.String sortOrder)
Sort a 2 dimensional array based on 1 columns data in either ascending or descending order. array - Array to be sorted sortCol - column to sort by sortOrder - sort the column in ascending or descending order. Valid arguments are "asc" and "desc".


disp

public static void disp(java.lang.Object[][] data)

allocateArray

public static java.lang.Object[][] allocateArray(int rows,
                                                 int cols)

getFormattedDateNow

public static java.lang.String getFormattedDateNow(java.lang.String format)
Formats todays date with the passed in date format String. See the main method for sample Formats


getFormattedDate

public static java.lang.String getFormattedDate(java.lang.String format,
                                                java.util.Date date)
Formats the passed in date with the passed in date format String. See the main method for sample Formats.


getMonth

public static java.lang.String getMonth(java.util.Date date)
Get the month out of the passed in Date. It would return 05 if you passed in the date 05/15/2004


getMonth

public static java.lang.String getMonth()
Return the 2 digit month of todays date


getDayOfWeek

public static java.lang.String getDayOfWeek(java.util.Date date)
Return the day of week from the passed in Date. For example Mon for Monday.


getDayOfWeek

public static java.lang.String getDayOfWeek()
Get the day of week for today. For example Mon for Monday.


getShortDate

public static java.lang.String getShortDate(java.util.Date date)
Get the short date for the passed in day. i.e 05/15/04


getShortDate

public static java.lang.String getShortDate()
Get the short date for Today. i.e 05/15/04


createCaseInsensitiveMap

public static java.util.Map createCaseInsensitiveMap()
Create a case insenstive Tree Map. More of a standard implementation that I wasn't aware of when creating AppMap. It may only be able to handle Strings as a key. That isn't clear


main

public static void main(java.lang.String[] args)