Documentation of 'mikera.vectorz.Tools' Java class
Tools
mikera.vectorz

Class Tools



  • public final class Tools
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void debugBreak(java.lang.Object o) 
      static boolean epsilonEquals(double a, double b)
      Tests if two double values are approximately equal
      static boolean epsilonEquals(double a, double b, double tolerance)
      Tests if two double values are approximately equal, up to a given tolerance
      static boolean equals(double a, double b)
      Tests if two double values are exactly equal
      static int hashCode(double d)
      Hashcode for a double primitive
      static int hashCode(int value)
      Hashcode for an int, defined as the value of the int itself for consistency with java.lang.Integer
      static int hashCode(long l)
      Hashcode for a long primitive
      static boolean isBoolean(double d) 
      static double toDouble(java.lang.Double d)
      Convenience overload to convert a Double to a primitive double
      static double toDouble(java.lang.Number d)
      Convenience overload to convert a Number to a primitive double
      static double toDouble(java.lang.Object object)
      Converts an numerical object to a primitive double Handles numbers and scalars
      static int toInt(double d)
      Convenience overload to convert a Double to a primitive double
      static int toInt(int d)
      Convenience overload to convert an int to a primitive int
      static int toInt(long d)
      Convenience overload to convert a primitive long to a primitive int Throws an exception if out of range.
      static int toInt(java.lang.Number d)
      Convenience overload to convert a Number to a primitive int
      static int toInt(java.lang.Object object)
      Converts an numerical object to a primitive double Handles numbers and scalars
      static <E> java.util.List<E> toList(java.lang.Iterable<E> iter) 
      static <T> java.util.ArrayList<T> toList(java.util.Iterator<T> iter)
      Function to create a list from an iterator
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • debugBreak

        public static void debugBreak(java.lang.Object o)
      • hashCode

        public static int hashCode(int value)
        Hashcode for an int, defined as the value of the int itself for consistency with java.lang.Integer
        Parameters:
        value -
        Returns:
      • hashCode

        public static int hashCode(double d)
        Hashcode for a double primitive
        Parameters:
        d -
        Returns:
      • hashCode

        public static int hashCode(long l)
        Hashcode for a long primitive
        Parameters:
        l -
        Returns:
      • toList

        public static <E> java.util.List<E> toList(java.lang.Iterable<E> iter)
      • toList

        public static <T> java.util.ArrayList<T> toList(java.util.Iterator<T> iter)
        Function to create a list from an iterator
        Parameters:
        iter -
        Returns:
      • toInt

        public static int toInt(java.lang.Object object)
        Converts an numerical object to a primitive double Handles numbers and scalars
      • toInt

        public static int toInt(long d)
        Convenience overload to convert a primitive long to a primitive int Throws an exception if out of range.
      • toInt

        public static int toInt(double d)
        Convenience overload to convert a Double to a primitive double
      • toInt

        public static int toInt(int d)
        Convenience overload to convert an int to a primitive int
      • toInt

        public static int toInt(java.lang.Number d)
        Convenience overload to convert a Number to a primitive int
      • toDouble

        public static double toDouble(java.lang.Object object)
        Converts an numerical object to a primitive double Handles numbers and scalars
      • toDouble

        public static double toDouble(java.lang.Double d)
        Convenience overload to convert a Double to a primitive double
      • toDouble

        public static double toDouble(java.lang.Number d)
        Convenience overload to convert a Number to a primitive double
      • epsilonEquals

        public static boolean epsilonEquals(double a,
                                            double b)
        Tests if two double values are approximately equal
        Parameters:
        a -
        b -
        Returns:
      • epsilonEquals

        public static boolean epsilonEquals(double a,
                                            double b,
                                            double tolerance)
        Tests if two double values are approximately equal, up to a given tolerance
      • equals

        public static boolean equals(double a,
                                     double b)
        Tests if two double values are exactly equal
      • isBoolean

        public static boolean isBoolean(double d)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.