|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectariba.util.formatter.Formatter
ariba.util.formatter.LongFormatter
public class LongFormatter
LongFormatter is a subclass of Formatter which
is responsible for formatting, parsing, and comparing long
values and/or Long objects.
| Field Summary | |
|---|---|
static String |
ClassName
Our Java class name. |
| Fields inherited from interface ariba.util.core.Compare |
|---|
EqualTo, GreaterThan, LessThan |
| Constructor Summary | |
|---|---|
LongFormatter()
Creates a new LongFormatter. |
|
| Method Summary | |
|---|---|
static int |
compareLongs(long l1,
long l2)
Compares two long values for sorting purposes. |
static int |
compareLongs(Long l1,
Long l2)
Compares two Long objects for sorting purposes. |
static long |
getLongValue(Object object)
Returns a long value derived from the given object in the
default locale. |
static String |
getStringValue(long value)
Returns a formatted string for the given long value in
the default locale. |
static String |
getStringValue(Long object)
Returns a formatted string for the given Long in the
default locale. |
static String |
getStringValue(long value,
Locale locale)
Returns a formatted string for the given long value in
the given locale. |
static String |
getStringValue(Long object,
Locale locale)
Returns a formatted string for the given Long in the
given locale. |
static String |
getStringValue(long value,
Locale locale,
boolean useGrouping)
Returns a formatted string for the given long value in
the given locale. |
static String |
getStringValue(Long object,
Locale locale,
boolean useGrouping)
Returns a formatted string for the given Long in the
given locale. |
static String |
getStringValue(long value,
Locale locale,
String pattern)
Returns a formatted string for the given long value in
the given locale. |
static String |
getStringValue(Long object,
Locale locale,
String pattern)
Returns a formatted string for the given Long in the
given locale. |
static String |
getStringValue(long value,
Locale locale,
String pattern,
boolean useGrouping)
Returns a formatted string for the given long value in
the given locale. |
static String |
getStringValue(Long object,
Locale locale,
String pattern,
boolean useGrouping)
Returns a formatted string for the given Long in the
given locale. |
Object |
getValue(Object object,
Locale locale)
Returns a new Long derived from the given object in the
given locale. |
static long |
parseLong(String string)
Tries to parse the given string as a long in the default
locale. |
static long |
parseLong(String string,
Locale locale)
Tries to parse the given string as a long in the given
locale. |
static long |
parseLong(String string,
Locale locale,
String pattern)
Tries to parse the given string as a long in the given
locale. |
| Methods inherited from class ariba.util.formatter.Formatter |
|---|
canFormatNulls, compare, compare, equal, equal, getFormat, getFormat, getFormatterClassForType, getFormatterForObject, getFormatterForType, getLocale, getStringValue, getStringValue, getValue, handlesNulls, isBidirectional, makeParseException, makeParseException, objectsAreEqual, objectsAreEqual, parse, parse, parseString, parseString, quickCompare, quickCompare, quickCompareValue, registerFormatter |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ClassName
| Constructor Detail |
|---|
public LongFormatter()
LongFormatter.
| Method Detail |
|---|
public static String getStringValue(Long object)
Long in the
default locale.
object - the Long to format into a string
Long
public static String getStringValue(Long object,
Locale locale)
Long in the
given locale. The locale parameter must be non-null.
object - the Long to format into a stringlocale - the Locale to use for formatting
Long,
or empty string if the Long is null
public static String getStringValue(Long object,
Locale locale,
String pattern)
Long in the
given locale. The locale parameter must be non-null.
object - the Long to format into a stringlocale - the Locale to use for formattingpattern - the DecimalFormat pattern to use for formatting
Long,
or empty string if the Long is nullDecimalFormat
public static String getStringValue(Long object,
Locale locale,
boolean useGrouping)
Long in the
given locale. The locale parameter must be non-null.
object - the Long to format into a stringlocale - the Locale to use for formattinguseGrouping - whether grouping characters should be used
Long,
or empty string if the Long is null
public static String getStringValue(Long object,
Locale locale,
String pattern,
boolean useGrouping)
Long in the
given locale. The locale parameter must be non-null.
object - the Long to format into a stringlocale - the Locale to use for formattingpattern - the DecimalFormat pattern to use for formattinguseGrouping - whether grouping characters should be used
Long,
or empty string if the Long is nullDecimalFormatpublic static String getStringValue(long value)
long value in
the default locale.
value - the long value to format into a string
long
public static String getStringValue(long value,
Locale locale)
long value in
the given locale. The locale parameter must be non-null.
value - the long value to format into a stringlocale - the Locale to use for formatting
long
public static String getStringValue(long value,
Locale locale,
String pattern)
long value in
the given locale. The locale parameter must be non-null.
value - the long value to format into a stringlocale - the Locale to use for formattingpattern - the DecimalFormat pattern to use for formatting
longDecimalFormat
public static String getStringValue(long value,
Locale locale,
boolean useGrouping)
long value in
the given locale. The locale parameter must be non-null.
value - the long value to format into a stringlocale - the Locale to use for formattinguseGrouping - whether grouping characters should be used
long
public static String getStringValue(long value,
Locale locale,
String pattern,
boolean useGrouping)
long value in
the given locale. The locale parameter must be non-null.
value - the long value to format into a stringlocale - the Locale to use for formattingpattern - the DecimalFormat pattern to use for formattinguseGrouping - whether grouping characters should be used
longDecimalFormat
public static long parseLong(String string)
throws ParseException
long in the default
locale.
string - the string to parse as a long
long value derived from the string
ParseException - if the string cannot be parsed as an
long
public static long parseLong(String string,
Locale locale)
throws ParseException
long in the given
locale.
string - the string to parse as a longlocale - the Locale to use for parsing
long value derived from the string
ParseException - if the string cannot be parsed as an
long
public static long parseLong(String string,
Locale locale,
String pattern)
throws ParseException
long in the given
locale.
string - the string to parse as a longlocale - the Locale to use for parsingpattern - the DecimalFormat pattern to use for parsing
long value derived from the string
ParseException - if the string cannot be parsed as an
longDecimalFormatpublic static long getLongValue(Object object)
long value derived from the given object in the
default locale. If the object is not a Long, it is
converted to a string and parsed. Returns zero if the object can't be
converted to a long.
object - the object to convert to an long value
long derived from the given object
public static int compareLongs(Long l1,
Long l2)
Long objects for sorting purposes. Returns
an int value which is less than, equal to, or greater
than zero depending on whether the first object sorts before, the
same, or after the second object.
l1 - the first Long to comparel2 - the second Long to compare
int value which determines how the two objects
should be ordered
public static int compareLongs(long l1,
long l2)
long values for sorting purposes. Returns an
int value which is less than, equal to, or greater than
zero depending on whether the first value sorts before, the same, or
after the second value.
l1 - the first long value to comparel2 - the second long value to compare
int value which determines how the two values
should be ordered
public Object getValue(Object object,
Locale locale)
Long derived from the given object in the
given locale. If the object is not a Long, it is
converted to a string and parsed. Returns null if the object can't be
parsed as a Long. The locale parameter is
currently unused.
getValue in class Formatterobject - the object to convert to a Longlocale - the Locale to use for conversion (unused)
Long derived from the given object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||