|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanetj.common.BusinessObject
planetj.common.CMUtility
This type was created in VisualAge.
Nested Class Summary | |
static class |
CMUtility.OverwriteOption
|
Field Summary | |
static java.lang.Class[] |
EMPTY_CLASS_ARRAY
|
static java.lang.Object[] |
EMPTY_OBJECT_ARRAY
|
static CMUtility.OverwriteOption |
OVERWRITE_ALWAYS
Always overwrite files when copying |
static CMUtility.OverwriteOption |
OVERWRITE_BY_TIMESTAMP
Overwrite files when copying if and only if the file being copied has a later timestamp than the one that would be overwritten |
static CMUtility.OverwriteOption |
OVERWRITE_NEVER
Never overwrite files when copying |
Fields inherited from class planetj.common.BusinessObject |
methodHashTable |
Constructor Summary | |
CMUtility()
|
Method Summary | |
static java.util.Vector |
arrayToVector(java.lang.Object[] array)
Insert the method's description here. |
static java.lang.String |
backslashApostrophes(java.lang.String s)
Inserts a backslash before any apostrophes in the String |
static int |
copy(java.io.File source,
java.io.File destination)
Copies a file or directory. |
static int |
copy(java.io.File source,
java.io.File destination,
java.util.List extensions,
CMUtility.OverwriteOption overwrite)
Copies a file or directory. |
static int |
copy(java.lang.String source,
java.lang.String destination)
Copies a file or directory. |
static int |
copy(java.lang.String source,
java.lang.String destination,
java.util.List extensions,
CMUtility.OverwriteOption overwrite)
Copies a file or directory. |
static boolean |
deleteFile(java.io.File pFile)
Removes the specified file or directory, and all subdirectories |
static boolean |
deleteFile(java.lang.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(java.lang.Object o1,
java.lang.Object o2)
Tests two Objects for equality |
static boolean |
equalsIgnoreCase(java.lang.String s1,
java.lang.String s2)
Tests two Strings for equality, ignoring case |
static java.math.BigDecimal |
getBigDecimal(int i)
Gets an BigDecimal object for the specified int, possibly from a cache |
static java.math.BigInteger |
getBigInteger(int i)
Gets an BigInteger object for the specified int, possibly from a cache |
static int |
getDifferenceInDays(java.util.Date from,
java.util.Date to)
Get the number of days between the two given dates (regardless of hours). |
static java.lang.reflect.Method |
getGetterMethod(java.lang.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(java.lang.Object o)
Gets an object's hashcode |
static java.lang.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(java.lang.Number val1,
java.lang.Number val2)
Gets the percentage difference between the two numbers. |
static java.lang.reflect.Method |
getSetterMethod(java.lang.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 java.lang.String |
getString(int i)
Gets a String representation for the given int, possibly from a cache. |
static double |
getVariancePercentage(java.lang.Number val1,
java.lang.Number val2)
Gets the percentage difference between the two numbers. |
static java.lang.Object |
invokeMethod(java.lang.Class targetObjectClass,
java.lang.String methodName,
java.lang.Class[] parameterTypes,
java.lang.Object[] params)
Invokes the specified method via reflection. |
static java.lang.Object |
invokeMethod(java.lang.Class targetObjectClass,
java.lang.String methodName,
java.lang.Object[] params)
Invokes the specified method via reflection. |
static java.lang.Object |
invokeMethod(java.lang.Object targetObject,
java.lang.Class targetObjectClass,
java.lang.String methodName,
java.lang.Class[] parameterTypes,
java.lang.Object[] parameters)
Invokes the specified method via reflection. |
static java.lang.Object |
invokeMethod(java.lang.Object targetObject,
java.lang.Class targetObjectClass,
java.lang.String methodName,
java.lang.Object[] params)
Invokes the specified method via reflection. |
static java.lang.String |
ipAddressToString(byte[] ipAddress)
Converts an IP address into a String |
static boolean |
isBeginsWith(java.lang.String mainString,
java.lang.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 |
isRunningInWSAD()
If we are running in Studio Application Developer |
static boolean |
isRunningInWSSDExpress()
If we are running in Studio Site Developer or not |
static boolean |
isStringContainNumeric(java.lang.String value)
Returns true if the any char in the String is numeric |
static boolean |
isStringNumeric(java.lang.String value)
Test if the given String contains all digits/numbers. |
static java.lang.StringBuffer |
mergeStrings(java.lang.StringBuffer pBuffer,
java.lang.String pString)
This will merge pString into pBuffer |
static int |
moveElementDownOne(java.util.List l,
int index)
Takes a ltor and the index and moves the element up one position |
static int |
moveElementUpOne(java.util.List l,
int index)
Takes a ltor and the index and moves the element up one position |
static MethodProperties |
parseMethod(java.lang.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(java.lang.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 java.lang.String |
stripOffAllNonNumericCharacters(java.lang.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 float[] |
toFloatArray(java.util.List strings)
Converts the values in a List with to float values. |
static java.util.List |
toList(java.util.Enumeration e)
Adds all elements in the Enumeration to a new List |
static java.util.List |
toList(java.util.Iterator i)
Adds all elements in the Iterator to a new List |
static java.util.List |
toLowerCase(java.util.List l)
Lowercases a List of String objects. |
static java.util.List |
toUpperCase(java.util.List l)
Uppercases a List of String objects. |
static java.util.List |
trim(java.util.List pStrings)
Trims a List of Strings |
static java.lang.String |
trim(java.lang.String inpString)
trim String object and ensure nulls are not returned |
static java.util.List |
trimNulls(java.util.List pList)
Removes all null references from the end of the List |
static java.lang.String |
trimTo(java.lang.String string,
int x)
trim String object to x characters in length and ensure nulls are not returned |
static java.lang.String |
trimTrailing(java.lang.String pString)
Returns a String with all trailing white spaces removed. |
static boolean |
validateAS400Name(java.lang.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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static CMUtility.OverwriteOption OVERWRITE_ALWAYS
public static CMUtility.OverwriteOption OVERWRITE_NEVER
public static CMUtility.OverwriteOption OVERWRITE_BY_TIMESTAMP
public static final java.lang.Class[] EMPTY_CLASS_ARRAY
public static final java.lang.Object[] EMPTY_OBJECT_ARRAY
Constructor Detail |
public CMUtility()
Method Detail |
public static java.util.Vector arrayToVector(java.lang.Object[] array)
array
- java.lang.Object[]
public static final java.lang.String backslashApostrophes(java.lang.String s)
public static int copy(java.io.File source, java.io.File destination) throws java.io.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.
java.io.IOException
public static int copy(java.io.File source, java.io.File destination, java.util.List extensions, CMUtility.OverwriteOption overwrite) throws java.io.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.extensions
- A list of the case sensitive file extensions that should be copied. (The
file extension is everything after the last period in the file name.) Files specified by
source which end in extensions other than those specified in the list will not be copied. If the
extension list is null, then all files will be copied. The extension list has no effect on whether
directories are copied or notoverwrite
- Constant describing how to handle cases where the file to be written to already exists
java.io.IOException
public static int copy(java.lang.String source, java.lang.String destination) throws java.io.IOException
source
- The file or directory to copydestination
- The directory to copy to. This directory must exist already.
java.io.IOException
public static int copy(java.lang.String source, java.lang.String destination, java.util.List extensions, CMUtility.OverwriteOption overwrite) throws java.io.IOException
source
- The file or directory to copydestination
- The directory to copy to. This directory must exist already.extensions
- A list of the case sensitive file extensions that should be copied. (The
file extension is everything after the last period in the file name.) Files specified by
source which end in extensions other than those specified in the list will not be copied. If the
extension list is null, then all files will be copied. The extension list has no effect on whether
directories are copied or notoverwrite
- Constant describing how to handle cases where the file to be written to already exists
java.io.IOException
public static boolean deleteFile(java.io.File pFile)
pFile
- The file or directory that you wish to deletepublic static boolean deleteFile(java.lang.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(java.lang.Object o1, java.lang.Object o2)
public static final boolean equalsIgnoreCase(java.lang.String s1, java.lang.String s2)
public static final java.math.BigDecimal getBigDecimal(int i)
public static final int getDifferenceInDays(java.util.Date from, java.util.Date to)
public static final java.math.BigInteger getBigInteger(int i)
public static java.lang.reflect.Method getGetterMethod(java.lang.Class c, MethodProperties mp) throws java.lang.NoSuchMethodException
Note: this method is only used for retrieving methods with a String[] paramter.
c
- Classmp
- MethodProperties
java.lang.NoSuchMethodException
public static final int getHashCode(java.lang.Object o)
public static final java.lang.Integer getInteger(int i)
public static int getNumberOfDigits(int number)
public static double getPercentage(java.lang.Number val1, java.lang.Number val2)
public static java.lang.reflect.Method getSetterMethod(java.lang.Class c, MethodProperties mp) throws java.lang.NoSuchMethodException
Note: this method is only used for retrieving methods with a String[] paramter.
c
- Classmp
- MethodProperties
java.lang.NoSuchMethodException
public static final java.lang.String getString(int i)
public static double getVariancePercentage(java.lang.Number val1, java.lang.Number val2)
public static final java.lang.Object invokeMethod(java.lang.Class targetObjectClass, java.lang.String methodName, java.lang.Class[] parameterTypes, java.lang.Object[] params) throws java.lang.Exception
targetObjectClass
- java.lang.ClassmethodName
- java.lang.StringparameterTypes
- java.Class[]params
- java.util.Object[]
java.lang.Exception
public static final java.lang.Object invokeMethod(java.lang.Class targetObjectClass, java.lang.String methodName, java.lang.Object[] params) throws java.lang.Exception
targetObjectClass
- java.lang.ClassmethodName
- java.lang.Stringparams
- java.util.Object[]
java.lang.Exception
public static final java.lang.Object invokeMethod(java.lang.Object targetObject, java.lang.Class targetObjectClass, java.lang.String methodName, java.lang.Class[] parameterTypes, java.lang.Object[] parameters) throws java.lang.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[]
java.lang.Exception
public static final java.lang.Object invokeMethod(java.lang.Object targetObject, java.lang.Class targetObjectClass, java.lang.String methodName, java.lang.Object[] params) throws java.lang.Exception
targetObject
- java.lang.ObjecttargetObjectClass
- java.lang.ClassmethodName
- java.lang.Stringparams
- java.util.Object[]
java.lang.Exception
public static final java.lang.String ipAddressToString(byte[] ipAddress)
public static final boolean isBeginsWith(java.lang.String mainString, java.lang.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 final boolean isRunningInWSAD()
public static boolean isStringContainNumeric(java.lang.String value)
public static boolean isStringNumeric(java.lang.String value)
public static final java.lang.StringBuffer mergeStrings(java.lang.StringBuffer pBuffer, java.lang.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(java.util.List l, int index)
public static final int moveElementUpOne(java.util.List l, int index)
public static MethodProperties parseMethod(java.lang.String method)
method
- String
MethodProperties
public static void runClientSideApplication(java.lang.String path) throws java.lang.Exception
java.lang.Exception
public static final void startSystemTimer()
public static final java.lang.String stripOffAllNonNumericCharacters(java.lang.String alphaChars)
public static final int sum(int[] numbers)
public static float[] toFloatArray(java.util.List strings)
public static java.util.List toList(java.util.Enumeration e)
public static java.util.List toList(java.util.Iterator i)
public static java.util.List toLowerCase(java.util.List l)
public static java.util.List toUpperCase(java.util.List l)
public static final java.util.List trim(java.util.List pStrings)
public static final java.lang.String trim(java.lang.String inpString)
public static final java.util.List trimNulls(java.util.List pList)
public static final java.lang.String trimTo(java.lang.String string, int x)
public static final java.lang.String trimTrailing(java.lang.String pString)
public static final boolean validateAS400Name(java.lang.String name)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |