Class JSType

java.lang.Object
com.oracle.js.parser.JSType

public final class JSType extends Object
Representation for ECMAScript types - this maps directly to the ECMA script standard
  • Method Details

    • isRepresentableAsInt

      public static boolean isRepresentableAsInt(double number)
      Returns true if double number can be represented as an int. Note that it returns true for negative zero. If you need to exclude negative zero, use isStrictlyRepresentableAsInt(double).
      Parameters:
      number - a double to inspect
      Returns:
      true for int representable doubles
    • isStrictlyRepresentableAsInt

      public static boolean isStrictlyRepresentableAsInt(double number)
      Returns true if double number can be represented as an int. Note that it returns false for negative zero. If you don't need to distinguish negative zero, use isRepresentableAsInt(double).
      Parameters:
      number - a double to inspect
      Returns:
      true for int representable doubles
    • isRepresentableAsLong

      public static boolean isRepresentableAsLong(double number)
      Returns true if double number can be represented as a long. Note that it returns true for negative zero. If you need to exclude negative zero, use isStrictlyRepresentableAsLong(double).
      Parameters:
      number - a double to inspect
      Returns:
      true for long representable doubles
    • isStrictlyRepresentableAsLong

      public static boolean isStrictlyRepresentableAsLong(double number)
      Returns true if double number can be represented as a long. Note that it returns false for negative zero. If you don't need to distinguish negative zero, use isRepresentableAsLong(double).
      Parameters:
      number - a double to inspect
      Returns:
      true for long representable doubles