Tabnine Logo
Types.isNumber
Code IndexAdd Tabnine to your IDE (free)

How to use
isNumber
method
in
js.util.Types

Best Java code snippets using js.util.Types.isNumber (Showing top 10 results out of 315)

origin: com.js-lib/js-commons

/**
 * Test if object instance is primitive numeric value or related boxing class. Returns true if given instance is a
 * primitive numeric value or related boxing class. Returns false if instance is null.
 * 
 * @param o object instance, possible null.
 * @return true if instance is a number.
 */
public static boolean isNumber(Object o)
{
 return o != null && isNumber(o.getClass());
}
origin: com.js-lib/js-xhtml-template

  /**
   * Current implementation of comparison processor accept numbers and dates.
   */
  @Override
  public boolean acceptValue(Object value) {
    if (Types.isNumber(value)) {
      return true;
    }
    if (Types.isDate(value)) {
      return true;
    }
    return false;
  }
}
origin: com.js-lib/js-xhtml-template

  /**
   * Check operand format compatibility against value counterpart.
   * 
   * @param value content value to validate operand against,
   * @param operand formatted string operand.
   * @return true if <code>operand</code> format is compatible with requested <code>value</code>.
   */
  public static boolean isValid(Object value, String operand) {
    if (operand == null) {
      // validation is enacted only for operator processors that do not accept null operand
      // so always return false
      return false;
    }
    if (Types.isBoolean(value)) {
      return BOOLEAN_PATTERN.matcher(operand).matches();
    }
    if (Types.isNumber(value)) {
      return NUMBER_PATTERN.matcher(operand).matches();
    }
    if (Types.isDate(value)) {
      return DATE_PATTERN.matcher(operand).matches();
    }
    return true;
  }
}
origin: com.js-lib/js-xhtml-template

  return value.toString().toLowerCase();
if (Types.isNumber(value)) {
  NumberFormat nf = scriptNumberFormat.get();
  if (nf == null) {
origin: com.js-lib/js-xhtml-template

  return null;
if (Types.isNumber(value)) {
  value = value.toString();
origin: com.js-lib/js-commons

 return (Boolean)o;
if(isNumber(o)) {
 return ((Number)o).byteValue() != 0;
origin: com.js-lib/js-commons

 return (Boolean)o == false;
if(isNumber(o)) {
 return ((Number)o).byteValue() == 0;
origin: com.js-lib/js-xhtml-template

@Override
public boolean evaluate(Object value, String operand) {
  if (Types.isNumber(value)) {
    Converter converter = ConverterRegistry.getConverter();
    Double doubleValue = ((Number) value).doubleValue();
    Double doubleOperand = 0.0;
    if (value instanceof Float) {
      // converting float to double may change last decimal digits
      // we need to ensure both value and operand undergo the same treatment, i.e. use Float#doubleValue() method
      // for both
      // for example float number 1.23F is converted to double to 1.2300000190734863
      // if we convert string "1.23" to double we have 1.23 != 1.2300000190734863
      Float floatOperand = converter.asObject(operand, Float.class);
      doubleOperand = floatOperand.doubleValue();
    } else {
      doubleOperand = converter.asObject(operand, Double.class);
    }
    return compare(doubleValue, doubleOperand);
  }
  if (Types.isDate(value)) {
    Date dateValue = (Date) value;
    Date dateOperand = Dates.parse(operand);
    return compare(dateValue, dateOperand);
  }
  return false;
}
origin: com.js-lib/js-commons

/**
 * Test if type is like a primitive? Return true only if given type is a number, boolean, enumeration, character or
 * string.
 * 
 * @param t type to test.
 * @return true if this type is like a primitive.
 */
public static boolean isPrimitiveLike(Type t)
{
 if(isNumber(t)) {
  return true;
 }
 if(isBoolean(t)) {
  return true;
 }
 if(isEnum(t)) {
  return true;
 }
 if(isCharacter(t)) {
  return true;
 }
 if(isDate(t)) {
  return true;
 }
 if(t == String.class) {
  return true;
 }
 return false;
}
origin: com.js-lib/js-json

if (Types.isNumber(value)) {
  write(converter.asString(value));
  return;
js.utilTypesisNumber

Javadoc

Test if object instance is primitive numeric value or related boxing class. Returns true if given instance is a primitive numeric value or related boxing class. Returns false if instance is null.

Popular methods of Types

  • isArrayLike
    Test if type is array like, that is, array or collection. Uses #isArray(Type) and #isCollection(Type
  • isMap
    Test if type is map. Returns true if type implements, directly or through inheritance, Map interface
  • isBoolean
    Test if type is a boolean primitive or boxing class.
  • isKindOf
    Determine if a given type is a kind of one of the requested types to match. Traverses typesToMatch a
  • isPrimitiveLike
    Test if type is like a primitive? Return true only if given type is a number, boolean, enumeration,
  • asIterable
    Convert object instance to iterable. If object instance is an array or a collection returns an itera
  • isArray
    Test if type is array. If type is a class return Class#isArray() predicate value; otherwise test if
  • isCollection
    Test if type is collection. Returns true if type implements, directly or through inheritance, Collec
  • isDate
    Test if type is a calendar date.
  • isEnum
    Test if type is enumeration. This predicate delegates Class#isEnum() if type is a class. If not, ret
  • isInstanceOf
    Test if object instance is not null and extends or implements expected type. This predicate consider
  • isPrimitive
    Test if type is primitive. Primitive types are those considered so by Class#isPrimitive().
  • isInstanceOf,
  • isPrimitive,
  • isVoid,
  • asBoolean,
  • equalsAny,
  • getEmptyValue,
  • isCharacter,
  • isConcrete,
  • isEqual

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (ScheduledExecutorService)
  • startActivity (Activity)
  • getSharedPreferences (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • JTable (javax.swing)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now