|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlbg.common.io.CommonStringHandling
public abstract class CommonStringHandling
A CommonStringHandling provides common String handling routines.
Field Summary | |
---|---|
static byte[] |
DUMMY_BYTE_ARRAY
Zero-sized, dummy byte array. |
static byte[][] |
DUMMY_BYTE_MATRIX
Zero-sized, dummy byte matrix. |
static byte[] |
DUMMY_LOG
Zero-sized, dummy String, intended to be used as a dummy execution log. |
static MetaGridData[] |
DUMMY_MGD_ARRAY
Zero-sized, dummy MetaGridData array. |
static java.lang.Object[] |
DUMMY_OBJECT_ARRAY
Zero-sized, dummy Object array. |
static java.lang.String |
DUMMY_STRING
Dummy String. |
static java.lang.String[] |
DUMMY_STRING_ARRAY
Zero-sized, dummy String array. |
Constructor Summary | |
---|---|
CommonStringHandling()
|
Method Summary | ||
---|---|---|
static java.lang.String |
doNotEditNotice()
Returns a DO NOT EDIT notice. |
|
static java.lang.String |
fillWithHeadingCharacter(long i,
int len,
char c)
Generates a String representation of target int, filled with target heading character, if target int is smaller than target power of 10. |
|
static java.lang.String |
fillWithHeadingSpaces(long i,
int len)
Generates a String representation of target int, filled with heading spaces, if target int is smaller than target power of 10. |
|
static java.lang.String |
fillWithHeadingZeros(long i,
int len)
Generates a String representation of target int, filled with heading zeros, if target int is smaller than target power of 10. |
|
static java.lang.String |
fillWithHeadingZerosLimit(long i,
long j)
Generates a String representation of target int, filled with heading zeros if target int if smaller than target limit. |
|
static java.lang.String |
formatIntegerDoubleAsInteger(double d)
Formats floating-point literal as a String, removing trailing .0 if present. |
|
static java.lang.String |
generateTimeStamp()
Generates a timestamp, i.e. |
|
static java.lang.String |
getStackTrace(java.lang.String msg)
Formats as a String the current stack trace using target message. |
|
static java.lang.String |
getStackTrace(java.lang.Throwable thr)
Formats as a String the stack trace of target Throwable. |
|
static boolean |
loadBoolean(java.lang.String s)
Loads a boolean from target String. |
|
static boolean[] |
loadBooleanArray(java.lang.String s)
Loads a boolean array from target String. |
|
static double |
loadDouble(java.lang.String s)
Loads a double from target String. |
|
static double[] |
loadDoubleArray(java.lang.String s)
Loads a double array from target String. |
|
static float |
loadFloat(java.lang.String s)
Loads a float from target String. |
|
static float[] |
loadFloatArray(java.lang.String s)
Loads a float array from target String. |
|
static int |
loadInt(java.lang.String s)
Loads an integer from target String. |
|
static int[] |
loadIntArray(java.lang.String s)
Loads an integer array from target String. |
|
static long |
loadLong(java.lang.String s)
Loads a log from target String. |
|
static long[] |
loadLongArray(java.lang.String s)
Loads a long array from target String. |
|
static java.lang.String |
loadProperty(java.lang.String key,
java.util.Properties props)
Loads property from target Properties given target key. |
|
static java.lang.String[] |
loadStringArray(java.lang.String s)
Loads a String array from target String. |
|
static
|
mergeArrays(T[] a1,
T[]... ax)
Merges the target arrays into one new array, so that the resulting array is a concatenation of the target arrays. |
|
static java.lang.String[] |
mergeStringArrays(java.lang.String[] a1,
java.lang.String[] a2)
Deprecated. Use mergeArrays(T[], T[]...) instead |
|
static java.lang.String |
replaceTag(java.lang.String s,
java.lang.String old_tag,
java.lang.String new_tag)
Replace a tag by another tag at the head of target String. |
|
static void |
setGroupProperty(java.util.Properties props,
java.lang.String key,
boolean[] values)
Sets target Properties with target (key, group values) pair. |
|
static void |
setGroupProperty(java.util.Properties props,
java.lang.String key,
double[] values)
Sets target Properties with target (key, group values) pair. |
|
static void |
setGroupProperty(java.util.Properties props,
java.lang.String key,
float[] values)
Sets target Properties with target (key, group values) pair. |
|
static void |
setGroupProperty(java.util.Properties props,
java.lang.String key,
int[] values)
Sets target Properties with target (key, group values) pair. |
|
static void |
setGroupProperty(java.util.Properties props,
java.lang.String key,
long[] values)
Sets target Properties with target (key, group values) pair. |
|
static void |
setGroupProperty(java.util.Properties props,
java.lang.String key,
java.lang.String value,
int s)
Sets target Properties with target (key, group value) pair. |
|
static void |
setGroupProperty(java.util.Properties props,
java.lang.String key,
java.lang.String value_all_except_one,
java.lang.String value_last,
int s)
Sets target Properties with target (key, group value) pair. |
|
static void |
setProperty(java.util.Properties props,
java.lang.String key,
java.lang.String value)
Sets target Properties with target (key, value) pair. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte[] DUMMY_LOG
public static final java.lang.String DUMMY_STRING
public static final java.lang.String[] DUMMY_STRING_ARRAY
public static final MetaGridData[] DUMMY_MGD_ARRAY
public static final java.lang.Object[] DUMMY_OBJECT_ARRAY
public static final byte[] DUMMY_BYTE_ARRAY
public static final byte[][] DUMMY_BYTE_MATRIX
Constructor Detail |
---|
public CommonStringHandling()
Method Detail |
---|
public static java.lang.String loadProperty(java.lang.String key, java.util.Properties props) throws GridException
key
- target keyprops
- target Properties
GridException
- if target key or Properties are illegalpublic static void setProperty(java.util.Properties props, java.lang.String key, java.lang.String value) throws GridException
GridException
public static void setGroupProperty(java.util.Properties props, java.lang.String key, java.lang.String value, int s) throws GridException
GridException
public static void setGroupProperty(java.util.Properties props, java.lang.String key, java.lang.String value_all_except_one, java.lang.String value_last, int s) throws GridException
GridException
public static void setGroupProperty(java.util.Properties props, java.lang.String key, int[] values) throws GridException
GridException
public static void setGroupProperty(java.util.Properties props, java.lang.String key, long[] values) throws GridException
GridException
public static void setGroupProperty(java.util.Properties props, java.lang.String key, float[] values) throws GridException
GridException
public static void setGroupProperty(java.util.Properties props, java.lang.String key, double[] values) throws GridException
GridException
public static void setGroupProperty(java.util.Properties props, java.lang.String key, boolean[] values) throws GridException
GridException
public static boolean loadBoolean(java.lang.String s) throws GridException
s
- target String
GridException
- if target String is illegalpublic static int loadInt(java.lang.String s) throws GridException
s
- target String
GridException
- if target String is illegalpublic static long loadLong(java.lang.String s) throws GridException
s
- target String
GridException
- if target String is illegalpublic static float loadFloat(java.lang.String s) throws GridException
s
- target String
GridException
- if target String is illegalpublic static double loadDouble(java.lang.String s) throws GridException
s
- target String
GridException
- if target String is illegalpublic static int[] loadIntArray(java.lang.String s) throws GridException
Accepted syntax is exactly the following : {x, y, z}, i.e. comma separated, exactly one space behind the comma, the whole thing being enclosed in braces with no spaces before or after them.
s
- target String
GridException
- if target String is illegalpublic static long[] loadLongArray(java.lang.String s) throws GridException
s
- target String
GridException
- if target String is illegalpublic static float[] loadFloatArray(java.lang.String s) throws GridException
s
- target String
GridException
- if target String is illegalpublic static double[] loadDoubleArray(java.lang.String s) throws GridException
s
- target String
GridException
- if target String is illegalpublic static java.lang.String[] loadStringArray(java.lang.String s) throws GridException
s
- target String
GridException
- if target String is illegalpublic static boolean[] loadBooleanArray(java.lang.String s) throws GridException
s
- target String
GridException
- if target String is illegalpublic static java.lang.String fillWithHeadingZerosLimit(long i, long j) throws GridException
Example: fillWithHeadingZerosLimit(42,100) -> "042".
i
- target intj
- target limit
GridException
- if a parameter is negativepublic static java.lang.String fillWithHeadingZeros(long i, int len) throws GridException
Example: fillWithHeadingZeros(42,3) -> "042".
i
- target intlen
- base 10 power of target limit
GridException
- if a parameter is negativepublic static java.lang.String fillWithHeadingSpaces(long i, int len) throws GridException
Example: fillWithHeadingZeros(42,3) -> " 42".
i
- target intlen
- base 10 power of target limit
GridException
- if a parameter is negativepublic static java.lang.String fillWithHeadingCharacter(long i, int len, char c) throws GridException
Example: fillWithHeadingZeros(42,3) -> "c42".
i
- target intlen
- base 10 power of target limitc
- target character
GridException
- if a parameter is negativepublic static java.lang.String replaceTag(java.lang.String s, java.lang.String old_tag, java.lang.String new_tag)
s
- target Stringold_tag
- old tagnew_tag
- new tag@Deprecated public static java.lang.String[] mergeStringArrays(java.lang.String[] a1, java.lang.String[] a2) throws GridException
mergeArrays(T[], T[]...)
instead
a1
- 1st target String arraya2
- 2nd target String array
GridException
- if a parameter is illegalpublic static <T> T[] mergeArrays(T[] a1, T[]... ax)
a1
- 1st target String arrayax
- The other arrays
java.lang.NullPointerException
- if any of the arrays is nullpublic static java.lang.String formatIntegerDoubleAsInteger(double d)
d
- target floating-poing literal
public static java.lang.String generateTimeStamp() throws GridException
GridException
public static java.lang.String doNotEditNotice()
public static java.lang.String getStackTrace(java.lang.Throwable thr)
thr
- target Throwable
public static java.lang.String getStackTrace(java.lang.String msg) throws GridException
msg
- target message
GridException
|
Lightweight Bartering Grid | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.