|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--planetj.common.BusinessObject | +--planetj.common.CMUtility
This type was created in VisualAge.
Field Summary | |
static Class[] |
EMPTY_CLASS_ARRAY
|
static Object[] |
EMPTY_OBJECT_ARRAY
|
Constructor Summary | |
CMUtility()
|
Method Summary | |
static Vector |
arrayToVector(Object[] array)
Insert the method's description here. |
static String |
backslashApostrophes(String s)
Inserts a backslash before any apostrophes in the String |
static int |
copy(File source,
File destination)
Copies a file or directory. |
static int |
copy(String source,
String destination)
Copies a file or directory. |
static boolean |
deleteFile(File pFile)
Removes the specified file or directory, and all subdirectories |
static boolean |
deleteFile(String pFilePath)
Removes the specified file or directory, and all subdirectories |
static long |
endSystemTimer()
endSystemTimer method records the currentTimeMillis and computes the time elapsed since the call to startSystemTimer(). |
static boolean |
equals(Object o1,
Object o2)
Tests two Objects for equality |
static boolean |
equalsIgnoreCase(String s1,
String s2)
Tests two Strings for equality, ignoring case |
static BigDecimal |
getBigDecimal(int i)
Gets an BigDecimal object for the specified int, possibly from a cache |
static BigInteger |
getBigInteger(int i)
Gets an BigInteger object for the specified int, possibly from a cache |
static int |
getDifferenceInDays(Date from,
Date to)
Get the number of days between the two given dates (regardless of hours). |
static Method |
getGetterMethod(Class c,
MethodProperties mp)
Gets the Method from the Class with the name specified in the MethodProperties object along with a String[] parameter containing all the Strings[] in the method properties object. |
static int |
getHashCode(Object o)
Gets an object's hashcode |
static Integer |
getInteger(int i)
Gets an Integer object for the specified int, possibly from a cache |
static int |
getNumberOfDigits(int number)
Get the number of digits for the given int. |
static double |
getPercentage(Number val1,
Number val2)
Gets the percentage difference between the two numbers. |
static Method |
getSetterMethod(Class c,
MethodProperties mp)
Gets the Method from the Class with the name specified in the MethodProperties object along with a String[] parameter containing all the Strings[] in the method properties object. |
static String |
getString(int i)
Gets a String representation for the given int, possibly from a cache. |
static double |
getVariancePercentage(Number val1,
Number val2)
Gets the percentage difference between the two numbers. |
static Object |
invokeMethod(Class targetObjectClass,
String methodName,
Class[] parameterTypes,
Object[] params)
Invokes the specified method via reflection. |
static Object |
invokeMethod(Class targetObjectClass,
String methodName,
Object[] params)
Invokes the specified method via reflection. |
static Object |
invokeMethod(Object targetObject,
Class targetObjectClass,
String methodName,
Class[] parameterTypes,
Object[] parameters)
Invokes the specified method via reflection. |
static Object |
invokeMethod(Object targetObject,
Class targetObjectClass,
String methodName,
Object[] params)
Invokes the specified method via reflection. |
static String |
ipAddressToString(byte[] ipAddress)
Converts an IP address into a String |
static boolean |
isBeginsWith(String mainString,
String startingString)
Tests if the first String begins with the second one |
static boolean |
isRunningInDevelopment()
Deprecated. - Replaced by CMUtility.isRunningInVA() |
static boolean |
isRunningInTomcat()
Test if this java program is running in Visual Age |
static boolean |
isRunningInVA()
Test if this java program is running in Visual Age |
static boolean |
isRunningInWAS()
If we are running in WAS or not |
static boolean |
isRunningInWASExpress()
If we are running in WAS Express or not |
static boolean |
isRunningInWindows()
Test if this java program is running on a Windows system |
static boolean |
isRunningInWSSDExpress()
If we are running in Studio Site Developer or not |
static boolean |
isStringContainNumeric(String value)
Returns true if the any char in the String is numeric |
static boolean |
isStringNumeric(String value)
Test if the given String contains all digits/numbers. |
static StringBuffer |
mergeStrings(StringBuffer pBuffer,
String pString)
This will merge pString into pBuffer |
static int |
moveElementDownOne(List l,
int index)
Takes a ltor and the index and moves the element up one position |
static int |
moveElementUpOne(List l,
int index)
Takes a ltor and the index and moves the element up one position |
static MethodProperties |
parseMethod(String method)
Takes the given String representing a Method, parses it into its method name and parameters, and then stores them in a MethodProperties object which can later be used to retrieve the different parts. |
static void |
runClientSideApplication(String path)
executes the given path and file EXAMPLE Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\iexplore.exe c:\\jmagic\\cave.htm"); |
static void |
startSystemTimer()
startSystemTime method records the currentTimeMillis of the system to be used for later calculation. |
static String |
stripOffAllNonNumericCharacters(String alphaChars)
stripOffAllNonNumericCharacters() will return a string of all intergers and strip off all values that are non-numeric |
static int |
sum(int[] numbers)
Sums up an array of integers |
static List |
toList(Enumeration e)
Adds all elements in the Enumeration to a new List |
static List |
toList(Iterator i)
Adds all elements in the Iterator to a new List |
static List |
toUpperCase(List l)
Uppercases a List of String objects. |
static List |
trim(List pStrings)
Trims a List of Strings |
static String |
trim(String inpString)
trim String object and ensure nulls are not returned |
static List |
trimNulls(List pList)
Removes all null references from the end of the List |
static String |
trimTo(String string,
int x)
trim String object to x characters in length and ensure nulls are not returned |
static String |
trimTrailing(String pString)
Returns a String with all trailing white spaces removed. |
static boolean |
validateAS400Name(String name)
Test the name String for AS400 naming compliance |
Methods inherited from class planetj.common.BusinessObject |
generateException, generateException, generateException, generateException, generateException, getTranslation, invoke, toBoolean, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Class[] EMPTY_CLASS_ARRAY
public static final Object[] EMPTY_OBJECT_ARRAY
Constructor Detail |
public CMUtility()
Method Detail |
public static Vector arrayToVector(Object[] array)
array
- java.lang.Object[]
public static final String backslashApostrophes(String s)
public static int copy(File source, File destination) throws IOException
source
- The file or directory to copy. If this is a directory, then the directory itself
(and not just the directory's contents) will be copieddestination
- The directory to copy to. This directory must exist already.
IOException
public static int copy(String source, String destination) throws IOException
source
- The file or directory to copydestination
- The directory to copy to. This directory must exist already.
IOException
public static boolean deleteFile(File pFile)
pFile
- The file or directory that you wish to deletepublic static boolean deleteFile(String pFilePath)
pFilePath
- The Absolute Path to a file or directory that you wish to deletepublic static final long endSystemTimer()
startSystemTimer
public static final boolean equals(Object o1, Object o2)
public static final boolean equalsIgnoreCase(String s1, String s2)
public static final BigDecimal getBigDecimal(int i)
public static final int getDifferenceInDays(Date from, Date to)
public static final BigInteger getBigInteger(int i)
public static Method getGetterMethod(Class c, MethodProperties mp) throws NoSuchMethodException
Note: this method is only used for retrieving methods with a String[] paramter.
c
- Classmp
- MethodProperties
NoSuchMethodException
public static final int getHashCode(Object o)
public static final Integer getInteger(int i)
public static int getNumberOfDigits(int number)
public static double getPercentage(Number val1, Number val2)
public static Method getSetterMethod(Class c, MethodProperties mp) throws NoSuchMethodException
Note: this method is only used for retrieving methods with a String[] paramter.
c
- Classmp
- MethodProperties
NoSuchMethodException
public static final String getString(int i)
public static double getVariancePercentage(Number val1, Number val2)
public static final Object invokeMethod(Class targetObjectClass, String methodName, Class[] parameterTypes, Object[] params) throws Exception
targetObjectClass
- java.lang.ClassmethodName
- java.lang.StringparameterTypes
- java.Class[]params
- java.util.Object[]
Exception
public static final Object invokeMethod(Class targetObjectClass, String methodName, Object[] params) throws Exception
targetObjectClass
- java.lang.ClassmethodName
- java.lang.Stringparams
- java.util.Object[]
Exception
public static final Object invokeMethod(Object targetObject, Class targetObjectClass, String methodName, Class[] parameterTypes, Object[] parameters) throws Exception
targetObject
- java.lang.Object The object the underlying method is invoked from. If the underlying method is static, then pass nulltargetObjectClass
- java.lang.StringmethodName
- java.lang.StringparameterTypes
- java.lang.Class[]
Exception
public static final Object invokeMethod(Object targetObject, Class targetObjectClass, String methodName, Object[] params) throws Exception
targetObject
- java.lang.ObjecttargetObjectClass
- java.lang.ClassmethodName
- java.lang.Stringparams
- java.util.Object[]
Exception
public static final String ipAddressToString(byte[] ipAddress)
public static final boolean isBeginsWith(String mainString, String startingString)
public static final boolean isRunningInDevelopment()
public static final boolean isRunningInTomcat()
public static final boolean isRunningInVA()
public static final boolean isRunningInWAS()
public static final boolean isRunningInWASExpress()
public static final boolean isRunningInWindows()
public static final boolean isRunningInWSSDExpress()
public static boolean isStringContainNumeric(String value)
public static boolean isStringNumeric(String value)
public static final StringBuffer mergeStrings(StringBuffer pBuffer, String pString)
Example: pBuffer.toString() = I the in hat pString = love cat the . Return value of pBuffer = I love the cat in the hat.
The text in the StringBuffer pBuffer will never be overriden by pString unless the value for that char is a blank ' '. Example: pBuffer.toString() = I love the in hat pString = hate cat the . Return value of pBuffer = I love the cat in the hat.
Creation date: (7/30/2002 3:08:17 PM)
public static final int moveElementDownOne(List l, int index)
public static final int moveElementUpOne(List l, int index)
public static MethodProperties parseMethod(String method)
method
- String
MethodProperties
public static void runClientSideApplication(String path) throws Exception
Exception
public static final void startSystemTimer()
public static final String stripOffAllNonNumericCharacters(String alphaChars)
public static final int sum(int[] numbers)
public static List toList(Enumeration e)
public static List toList(Iterator i)
public static List toUpperCase(List l)
public static final List trim(List pStrings)
public static final String trim(String inpString)
public static final List trimNulls(List pList)
public static final String trimTo(String string, int x)
public static final String trimTrailing(String pString)
public static final boolean validateAS400Name(String name)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |