|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xerox.amazonws.sdb.DataUtils
public class DataUtils
Provides collection of static functions for conversion of various values into strings that may be compared lexicographically.
| Constructor Summary | |
|---|---|
DataUtils()
|
|
| Method Summary | |
|---|---|
static Date |
decodeDate(String value)
Decodes date value from the string representation created using encodeDate(..) function. |
static double |
decodeDouble(String s)
|
static double |
decodeRealNumberRangeDouble(String value,
int maxDigitsRight,
long offsetValue)
Decodes double value from the string representation that was created by using encodeRealNumberRange(..) function. |
static float |
decodeRealNumberRangeFloat(String value,
int maxDigitsRight,
int offsetValue)
Decodes float value from the string representation that was created by using encodeRealNumberRange(..) function. |
static int |
decodeRealNumberRangeInt(String value,
int offsetValue)
Decodes integer value from the string representation that was created by using encodeRealNumberRange(..) function. |
static long |
decodeRealNumberRangeLong(String value,
long offsetValue)
Decodes long value from the string representation that was created by using encodeRealNumberRange(..) function. |
static double |
decodeZeroPaddingDouble(String value)
Decodes zero-padded positive double value from the string representation |
static float |
decodeZeroPaddingFloat(String value)
Decodes zero-padded positive float value from the string representation |
static int |
decodeZeroPaddingInt(String value)
Decodes zero-padded positive integer value from the string representation |
static long |
decodeZeroPaddingLong(String value)
Decodes zero-padded positive long value from the string representation |
static String |
encodeDate(Date date)
Encodes date value into string format that can be compared lexicographically |
static String |
encodeDouble(double d)
|
static String |
encodeRealNumberRange(double number,
int maxDigitsLeft,
int maxDigitsRight,
long offsetValue)
Encodes real double value into a string by offsetting and zero-padding number up to the specified number of digits. |
static String |
encodeRealNumberRange(float number,
int maxDigitsLeft,
int maxDigitsRight,
int offsetValue)
Encodes real float value into a string by offsetting and zero-padding number up to the specified number of digits. |
static String |
encodeRealNumberRange(int number,
int maxNumDigits,
int offsetValue)
Encodes real integer value into a string by offsetting and zero-padding number up to the specified number of digits. |
static String |
encodeRealNumberRange(long number,
int maxNumDigits,
int offsetValue)
Encodes real long value into a string by offsetting and zero-padding number up to the specified number of digits. |
static String |
encodeZeroPadding(double number,
int maxNumDigits)
Encodes positive double value into a string by zero-padding number up to the specified number of digits |
static String |
encodeZeroPadding(float number,
int maxNumDigits)
Encodes positive float value into a string by zero-padding number up to the specified number of digits |
static String |
encodeZeroPadding(int number,
int maxNumDigits)
Encodes positive integer value into a string by zero-padding number up to the specified number of digits. |
static String |
encodeZeroPadding(long number,
int maxNumDigits)
Encodes positive long value into a string by zero-padding number up to the specified number of digits. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataUtils()
| Method Detail |
|---|
public static String encodeZeroPadding(int number,
int maxNumDigits)
number - positive integer to be encodedmaxNumDigits - maximum number of digits in the largest value in the data set
public static String encodeZeroPadding(long number,
int maxNumDigits)
number - positive long to be encodedmaxNumDigits - maximum number of digits in the largest value in the data set
public static String encodeZeroPadding(float number,
int maxNumDigits)
number - positive float value to be encodedmaxNumDigits - maximum number of digits preceding the decimal point in the largest value in the data set
public static String encodeZeroPadding(double number,
int maxNumDigits)
number - positive double value to be encodedmaxNumDigits - maximum number of digits preceding the decimal point in the largest value in the data set
public static int decodeZeroPaddingInt(String value)
value - zero-padded string representation of the integer
public static long decodeZeroPaddingLong(String value)
value - zero-padded string representation of the long
public static float decodeZeroPaddingFloat(String value)
value - zero-padded string representation of the float value
public static double decodeZeroPaddingDouble(String value)
value - zero-padded string representation of the double value
public static String encodeRealNumberRange(int number,
int maxNumDigits,
int offsetValue)
number - integer to be encodedmaxNumDigits - maximum number of digits in the largest absolute value in the data setoffsetValue - offset value, has to be greater than absolute value of any negative number in the data set.
public static String encodeRealNumberRange(long number,
int maxNumDigits,
int offsetValue)
number - long to be encodedmaxNumDigits - maximum number of digits in the largest absolute value in the data setoffsetValue - offset value, has to be greater than absolute value of any negative number in the data set.
public static String encodeRealNumberRange(float number,
int maxDigitsLeft,
int maxDigitsRight,
int offsetValue)
number - float to be encodedmaxDigitsLeft - maximum number of digits left of the decimal point in the largest absolute value in the data setmaxDigitsRight - maximum number of digits right of the decimal point in the largest absolute value in the data set, i.e. precisionoffsetValue - offset value, has to be greater than absolute value of any negative number in the data set.
public static String encodeRealNumberRange(double number,
int maxDigitsLeft,
int maxDigitsRight,
long offsetValue)
number - double to be encodedmaxDigitsLeft - maximum number of digits left of the decimal point in the largest absolute value in the data setmaxDigitsRight - maximum number of digits right of the decimal point in the largest absolute value in the data set, i.e. precisionoffsetValue - offset value, has to be greater than absolute value of any negative number in the data set.
public static int decodeRealNumberRangeInt(String value,
int offsetValue)
value - string representation of the integer valueoffsetValue - offset value that was used in the original encoding
public static long decodeRealNumberRangeLong(String value,
long offsetValue)
value - string representation of the long valueoffsetValue - offset value that was used in the original encoding
public static float decodeRealNumberRangeFloat(String value,
int maxDigitsRight,
int offsetValue)
value - string representation of the integer valuemaxDigitsRight - maximum number of digits left of the decimal point in
the largest absolute value in the data set (must be the same as the one used for encoding).offsetValue - offset value that was used in the original encoding
public static double decodeRealNumberRangeDouble(String value,
int maxDigitsRight,
long offsetValue)
value - string representation of the integer valuemaxDigitsRight - maximum number of digits left of the decimal point in
the largest absolute value in the data set (must be the same as the one used for encoding).offsetValue - offset value that was used in the original encoding
public static String encodeDate(Date date)
date - date value to be encoded
public static Date decodeDate(String value)
throws ParseException
value - string representation of the date value
ParseExceptionpublic static String encodeDouble(double d)
public static double decodeDouble(String s)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||