|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--SDDS.java.SDDS.SDDSUtil
The SDDS Utility object is used for miscellaneous static methods. It it reqired by the SDDS File, SDDS Parameter, and SDDS Column object.
| Field Summary | |
static int |
SDDS_CHARACTER
|
static int |
SDDS_DOUBLE
|
static int |
SDDS_FLOAT
|
static int |
SDDS_LONG
|
static int |
SDDS_NUM_TYPES
|
static int |
SDDS_SHORT
|
static int |
SDDS_STRING
|
static java.lang.String[] |
SDDS_type_name
|
| Constructor Summary | |
SDDSUtil()
|
|
| Method Summary | |
static double[] |
castArrayAsDouble(float[] array)
Convert elements to double precision |
static double[] |
castArrayAsDouble(java.lang.Object[] array,
int type)
Convert elements to double precision |
static long[] |
castArrayAsLong(int[] array)
Convert elements to long precision |
static long[] |
castArrayAsLong(short[] array)
Convert elements to long precision |
static java.lang.String[] |
castArrayAsString(char[] array)
Convert elements to Strings |
static boolean |
compare(java.lang.String value1,
java.lang.String value2)
Compare two strings to see if one starts with the other |
static java.lang.String |
getTypeName(int type)
Get data type name from integer data type value. |
static boolean |
globMatch(java.lang.String s1,
java.lang.String pattern)
Do a glob style string match |
static int |
identifyType(java.lang.String typeName)
Get integer data type value from data type name. |
static boolean |
isValidName(java.lang.String name)
Determine if string is a valid name. |
static boolean |
isValidType(int type)
Determine if data type is a valid type. |
static java.lang.String[][] |
parseCommandLine(java.lang.String[] args)
Parse the command line into a string array |
static java.lang.String |
prepareString(java.lang.String data)
Prepare string to be written to a file |
static java.lang.String |
removeBackSlashes(java.lang.String s1)
Remove backslashes from the string |
static java.lang.String |
removeComments(java.lang.String s1)
Search for \ and ! in the string |
static java.lang.Object |
resize(java.lang.Object array,
int newLength)
Resize array while keeping existing elements |
static java.lang.Object |
resize(java.lang.Object array,
int offset,
int newLength)
Resize array while keeping existing elements |
static char |
returnCharValueFromOctalCode(java.lang.String s1)
Return character from octal code |
static java.lang.String |
strchop(java.lang.String s1,
int index)
Return the substring from the index to the end of the string |
static boolean |
strncmp(java.lang.String s1,
java.lang.String s2,
int length)
Compare two strings up to a given length |
static boolean |
verifyPrintfFormat(java.lang.String s,
int type)
Verify that format string is valid. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int SDDS_SHORT
public static final int SDDS_LONG
public static final int SDDS_FLOAT
public static final int SDDS_DOUBLE
public static final int SDDS_STRING
public static final int SDDS_CHARACTER
public static final int SDDS_NUM_TYPES
public static java.lang.String[] SDDS_type_name
| Constructor Detail |
public SDDSUtil()
| Method Detail |
public static long[] castArrayAsLong(short[] array)
array - a short precision number arraypublic static long[] castArrayAsLong(int[] array)
array - a int precision number arraypublic static double[] castArrayAsDouble(float[] array)
array - a float precision number array
public static double[] castArrayAsDouble(java.lang.Object[] array,
int type)
array - a numerical Object arraypublic static java.lang.String[] castArrayAsString(char[] array)
array - a char arraypublic static java.lang.String prepareString(java.lang.String data)
data - string to be prepared
public static boolean verifyPrintfFormat(java.lang.String s,
int type)
s - format stringtype - valid data typetrue if valid
false if not validpublic static boolean isValidName(java.lang.String name)
name - name to be tested for validity, the first
character should be a letter or .:
every other character of the name should be
a letter, digit, or one of the following:
@:#+%-._$&/[]true if validfalse if invalidpublic static boolean isValidType(int type)
type - valid values are:
1 for double2 for float3 for long4 for short5 for string6 for charactertrue if validfalse if invalidpublic static java.lang.String getTypeName(int type)
type - valid values are:
1 for double2 for float3 for long4 for short5 for string6 for characternull if invalidpublic static int identifyType(java.lang.String typeName)
typeName - valid values are:
"double""float""long""short""string""character"int type if valid0 if invalid
public static java.lang.Object resize(java.lang.Object array,
int offset,
int newLength)
array - array to be resizedoffset - offset indexnewLength - new length of array
public static java.lang.Object resize(java.lang.Object array,
int newLength)
array - array to be resizednewLength - new length of array
public static boolean strncmp(java.lang.String s1,
java.lang.String s2,
int length)
s1 - first string to compares2 - second string to comparelength - length to check strings
public static java.lang.String strchop(java.lang.String s1,
int index)
s1 - initial stringindex - index of stringpublic static java.lang.String removeComments(java.lang.String s1)
s1 - string to remove commentspublic static java.lang.String removeBackSlashes(java.lang.String s1)
s1 - string to remove backslashes frompublic static char returnCharValueFromOctalCode(java.lang.String s1)
s1 - string with octal codepublic static java.lang.String[][] parseCommandLine(java.lang.String[] args)
args - command line arguments
public static boolean compare(java.lang.String value1,
java.lang.String value2)
value1 - compare beginning with value2value2 - compare entire string with beginning of value1
public static boolean globMatch(java.lang.String s1,
java.lang.String pattern)
s1 - String to test for glob style matchingpattern - Pattern used for glob style matchingtrue if it does matchfalse if it does not match
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||