|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.sensorevent.model.generic.GenericUtils
public class GenericUtils
GenericUtils contains helper methods used throughout the sensor event model.
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT
|
Constructor Summary | |
---|---|
protected |
GenericUtils()
Constructs a new GenericUtils |
Method Summary | |
---|---|
static java.lang.String |
decode(java.lang.String s)
Decode the value |
static java.lang.String[] |
decode(java.lang.String[] s)
For all strings in the array, decode the values |
static java.lang.String |
encode(java.lang.String s)
Encode the string |
static java.lang.String[] |
encode(java.lang.String[] s)
For all strings in the array, encode the strings |
static java.lang.String[] |
encode(java.lang.String[] s,
int max)
For all strings in the array, encode the strings then truncate to max characters |
static java.lang.String |
encode(java.lang.String s,
int max)
Encode the string then truncate to max characters |
static java.lang.String |
formatISO8601Date(java.util.Date d)
Converts the given java.util.Date value as an ISO 8601 date string. |
static java.lang.String |
formatISO8601Date(long date)
Converts the given long millisecond value as an ISO 8601 date string. |
static java.util.Date |
parseISO8601Date(java.lang.String s)
Converts the given ISO 8601 date string into a java.util.Date. |
static java.lang.String |
replaceAll(java.lang.String target,
java.lang.String toReplace,
java.lang.String toReplaceWith)
Replaces all occurrences of String toReplace with String toReplaceWith in String target |
static java.lang.String[] |
split(java.lang.String s,
java.lang.String delim)
Splits the string at the delimiter (this method is necessary for J2ME environments instead of calling String.split) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
protected GenericUtils()
Method Detail |
---|
public static java.lang.String[] split(java.lang.String s, java.lang.String delim) throws SensorEventException
s
- delim
-
SensorEventException
public static java.lang.String encode(java.lang.String s)
s
- public static java.lang.String encode(java.lang.String s, int max)
s
- public static java.lang.String[] encode(java.lang.String[] s)
s
- public static java.lang.String[] encode(java.lang.String[] s, int max)
s
- public static java.lang.String decode(java.lang.String s)
s
- public static java.lang.String[] decode(java.lang.String[] s)
s
- public static java.lang.String replaceAll(java.lang.String target, java.lang.String toReplace, java.lang.String toReplaceWith) throws SensorEventException
target
- The string to searchtoReplace
- The string to search for within targettoReplaceWith
- The string to replace occurrences of toReplace within target
SensorEventException
public static java.lang.String formatISO8601Date(long date) throws SensorEventException
ISO 8601 date strings have the form
yyyy-MM-ddTHH:mm:ss.MMMZ
date
- The long millisecond value to format
SensorEventException
public static java.lang.String formatISO8601Date(java.util.Date d) throws SensorEventException
ISO 8601 date strings have the form
yyyy-MM-ddTHH:mm:ss.MMMZ
d
- The java.util.Date value to format
SensorEventException
public static java.util.Date parseISO8601Date(java.lang.String s) throws SensorEventException
ISO 8601 date strings have the form
yyyy-MM-ddTHH:mm:ss.MMMZ
s
- The string to convert
SensorEventException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |