|
|||||||||
| 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.BooleanFormatter
public class BooleanFormatter
BooleanFormatter is a subclass of Formatter
which is responsible for formatting, parsing, and comparing
boolean values and/or Boolean objects.
| Field Summary | |
|---|---|
static String |
BooleanTrueOrFalseKey
|
static String |
ClassName
Our Java class name. |
| Fields inherited from interface ariba.util.core.Compare |
|---|
EqualTo, GreaterThan, LessThan |
| Constructor Summary | |
|---|---|
BooleanFormatter()
Creates a new BooleanFormatter. |
|
| Method Summary | |
|---|---|
static int |
compareBooleans(boolean b1,
boolean b2)
Compares two boolean values for sorting purposes. |
static int |
compareBooleans(Boolean b1,
Boolean b2)
Compares two Boolean objects for sorting purposes. |
static boolean |
getBooleanValue(Object object)
Returns a boolean value derived from the given object. |
static String |
getStringValue(Boolean object)
Returns a formatted string for the given Boolean object
in the default locale. |
static String |
getStringValue(Boolean object,
Locale locale)
Returns a formatted string for the given Boolean object
in the given locale. |
Object |
getValue(Object object,
Locale locale)
Returns a new Boolean derived from the given object. |
static boolean |
parseBoolean(String string)
Parses the given string as a boolean value. |
static Boolean |
parseStringAsBoolean(String string)
Parses the given string as a Boolean value. |
| 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
public static final String BooleanTrueOrFalseKey
| Constructor Detail |
|---|
public BooleanFormatter()
BooleanFormatter.
| Method Detail |
|---|
public static String getStringValue(Boolean object)
Boolean object
in the default locale.
object - the Boolean object to format into a string
Boolean
object in the default locale
public static String getStringValue(Boolean object,
Locale locale)
Boolean object
in the given locale.
object - the Boolean object to format into a stringlocale - the Locale to use for formatting
Boolean
object in the given localepublic static boolean parseBoolean(String string)
boolean value. Returns true
if and only if the given string is "true".
string - the String to parse
true if the given string is
"true"; false otherwise.public static Boolean parseStringAsBoolean(String string)
Boolean value. Returns
Boolean.TRUE if and only if the given string is
"true".
string - the String to parse
Boolean.TRUE if the given string is
"true"; Boolean.FALSE
otherwise.public static boolean getBooleanValue(Object object)
boolean value derived from the given object.
If the object is not a Boolean, it is converted to a
string and compared against the string "true".
object - the object to covert to a boolean
boolean derived from the given object
public static int compareBooleans(Boolean b1,
Boolean b2)
Boolean 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. Sorts Boolean.TRUE
before Boolean.FALSE.
b1 - the first Boolean to compareb2 - the second Boolean to compare
int value which determines how the two objects
should be ordered
public static int compareBooleans(boolean b1,
boolean b2)
boolean values 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. Sorts true before
false.
b1 - the first boolean to compareb2 - the second boolean to compare
int value which determines how the two objects
should be ordered
public Object getValue(Object object,
Locale locale)
Boolean derived from the given object. If
the object is not a Boolean, it is converted to a string
and compared against the string "true".
getValue in class Formatterobject - the object to convert to a Booleanlocale - the Locale to use for conversion
Boolean derived from the given object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||