org.rythmengine.utils
Class Eval

java.lang.Object
  extended by org.rythmengine.utils.Eval

public class Eval
extends Object

Evaluate an object and return boolean value by convention


Constructor Summary
Eval()
           
 
Method Summary
static boolean eval(boolean b)
          return the specified boolean directly
static boolean eval(Boolean b)
           
static boolean eval(byte b)
          return true if the specified byte b != 0
static boolean eval(Byte b)
           
static boolean eval(char c)
          return true if the specified char c != 0
static boolean eval(Character c)
           
static boolean eval(Collection c)
          Return true if the collection is not empty
static boolean eval(double d)
          return true if the specified double Math.abs(f) > 0.00000001
static boolean eval(Double d)
           
static boolean eval(float f)
          return true if the specified float Math.abs(f) > 0.00000001
static boolean eval(Float f)
           
static boolean eval(int n)
          return true if the specified integer n != 0
static boolean eval(long l)
          return true if the specified long l != 0
static boolean eval(Map m)
          Return true if the map is not empty
static boolean eval(Number n)
          Evaluate the number's int value
static boolean eval(Object condition)
          General object type evaluation.
static boolean eval(String s)
          Return true if the specified string does not equals, ignore case, to "false" or "no"
static Locale locale(Locale locale)
          Eval Locale from a Locale
static Locale locale(String language)
          Eval locale from language string
static Locale locale(String language, String region)
          Eval locale from language and region
static Locale locale(String language, String region, String variant)
          Eval locale from language, region and variant
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Eval

public Eval()
Method Detail

eval

public static boolean eval(byte b)
return true if the specified byte b != 0

Parameters:
b -
Returns:
boolean result

eval

public static boolean eval(char c)
return true if the specified char c != 0

Parameters:
c -
Returns:
boolean result

eval

public static boolean eval(boolean b)
return the specified boolean directly

Parameters:
b -
Returns:
boolean result

eval

public static boolean eval(int n)
return true if the specified integer n != 0

Parameters:
n -
Returns:
boolean result

eval

public static boolean eval(long l)
return true if the specified long l != 0

Parameters:
l -
Returns:
boolean result

eval

public static boolean eval(float f)
return true if the specified float Math.abs(f) > 0.00000001

Parameters:
f -
Returns:
boolean result

eval

public static boolean eval(double d)
return true if the specified double Math.abs(f) > 0.00000001

Parameters:
d -
Returns:
boolean result

eval

public static boolean eval(String s)
Return true if the specified string does not equals, ignore case, to "false" or "no"

Parameters:
s -
Returns:
boolean result

eval

public static boolean eval(Collection c)
Return true if the collection is not empty

Parameters:
c -
Returns:
boolean result

eval

public static boolean eval(Map m)
Return true if the map is not empty

Parameters:
m -
Returns:
boolean result

eval

public static boolean eval(Byte b)
Parameters:
b -
Returns:
boolean result
See Also:
eval(boolean)

eval

public static boolean eval(Boolean b)
Parameters:
b -
Returns:
boolean result
See Also:
eval(boolean)

eval

public static boolean eval(Character c)
Parameters:
c -
Returns:
boolean result
See Also:
eval(char)

eval

public static boolean eval(Float f)
Parameters:
f -
Returns:
boolean result
See Also:
eval(float)

eval

public static boolean eval(Double d)
Parameters:
d -
Returns:
boolean result
See Also:
eval(double)

eval

public static boolean eval(Number n)
Evaluate the number's int value

Parameters:
n -
Returns:
boolean result
See Also:
eval(int)

eval

public static boolean eval(Object condition)
General object type evaluation.

Parameters:
condition -
Returns:
boolean result

locale

public static Locale locale(Locale locale)
Eval Locale from a Locale

Parameters:
locale -
Returns:
the specified locale directly

locale

public static Locale locale(String language)
Eval locale from language string

Parameters:
language -
Returns:
new Locale constructed from the language

locale

public static Locale locale(String language,
                            String region)
Eval locale from language and region

Parameters:
language -
region -
Returns:
new Locale constructed from the lauguage and region

locale

public static Locale locale(String language,
                            String region,
                            String variant)
Eval locale from language, region and variant

Parameters:
language -
region -
variant -
Returns:
the new Locale constructed


Copyright © 2013. All Rights Reserved.