mikera.vectorz
Class Tools
- java.lang.Object
-
- mikera.vectorz.Tools
-
public final class Tools extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voiddebugBreak(java.lang.Object o)static booleanepsilonEquals(double a, double b)Tests if two double values are approximately equalstatic booleanepsilonEquals(double a, double b, double tolerance)Tests if two double values are approximately equal, up to a given tolerancestatic booleanequals(double a, double b)Tests if two double values are exactly equalstatic inthashCode(double d)Hashcode for a double primitivestatic inthashCode(int value)Hashcode for an int, defined as the value of the int itself for consistency with java.lang.Integerstatic inthashCode(long l)Hashcode for a long primitivestatic booleanisBoolean(double d)static doubletoDouble(java.lang.Double d)Convenience overload to convert a Double to a primitive doublestatic doubletoDouble(java.lang.Number d)Convenience overload to convert a Number to a primitive doublestatic doubletoDouble(java.lang.Object object)Converts an numerical object to a primitive double Handles numbers and scalarsstatic inttoInt(double d)Convenience overload to convert a Double to a primitive doublestatic inttoInt(int d)Convenience overload to convert an int to a primitive intstatic inttoInt(long d)Convenience overload to convert a primitive long to a primitive int Throws an exception if out of range.static inttoInt(java.lang.Number d)Convenience overload to convert a Number to a primitive intstatic inttoInt(java.lang.Object object)Converts an numerical object to a primitive double Handles numbers and scalarsstatic <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
-
-
-
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