public class SimpleDBUtils extends Object
Constructor and Description |
---|
SimpleDBUtils() |
Modifier and Type | Method and Description |
---|---|
static Date |
decodeDate(String value)
Decodes date value from the string representation created using encodeDate(..) 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 a long value from the string representation that was created by using
encodeRealNumberRange(..) function.
|
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 a 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 |
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,
long offsetValue)
Encodes a positive or negative long value into a string by offsetting and zero-padding the
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 the value up to the specified
number of digits.
|
static String |
quoteName(String name)
Quotes and escapes an attribute name or domain name by wrapping it with backticks and
escaping any backticks inside the name.
|
static String |
quoteValue(String value)
Quotes and escapes an attribute value by wrapping it with single quotes and escaping any
single quotes inside the value.
|
static String |
quoteValues(Collection<String> values)
Quotes and escapes a list of values so that they can be used in a SimpleDB query.
|
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 setpublic static String encodeZeroPadding(long number, int maxNumDigits)
number
- positive long to be encodedmaxNumDigits
- maximum number of digits in the largest value in the data setpublic 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 setpublic static int decodeZeroPaddingInt(String value)
value
- zero-padded string representation of the integerpublic static long decodeZeroPaddingLong(String value)
value
- zero-padded string representation of the longpublic static float decodeZeroPaddingFloat(String value)
value
- zero-padded string representation of the float valuepublic 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, long offsetValue)
number
- positive or negative long value 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 int decodeRealNumberRangeInt(String value, int offsetValue)
value
- string representation of the integer valueoffsetValue
- offset value that was used in the original encodingpublic static long decodeRealNumberRangeLong(String value, long offsetValue)
value
- string representation of the long valueoffsetValue
- offset value that was used in the original encodingpublic 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 encodingpublic static String encodeDate(Date date)
date
- date value to be encodedpublic static Date decodeDate(String value) throws ParseException
value
- string representation of the date valueParseException
public static String quoteValues(Collection<String> values)
values
- The collection of attribute values that will be quoted, escaped, and included in
the returned string list.public static String quoteValue(String value)
value
- The attribute value to quote and escape.public static String quoteName(String name)
name
- The attribute name or domain name to quote and escape.Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.