public class Misc
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
alpha |
static double |
maxReletiveError |
static int |
objectSize |
static int |
referenceSize |
protected static java.lang.String |
slashalpha |
Constructor and Description |
---|
Misc() |
Modifier and Type | Method and Description |
---|---|
static boolean |
closeEnough(double v1,
double v2)
Check if numbers are equal with default tolerance
|
static boolean |
closeEnough(double v1,
double v2,
double maxRelDiff)
Check if numbers are equal with given reletive tolerance
|
static boolean |
closeEnough(float v1,
float v2)
Check if numbers are equal with default tolerance
|
static boolean |
closeEnough(float v1,
float v2,
float maxRelDiff) |
static boolean |
closeEnoughAbs(double v1,
double v2,
double maxAbsDiff)
Check if numbers are equal with given absolute tolerance
|
static boolean |
closeEnoughAbs(float v1,
float v2,
float maxAbsDiff) |
static boolean |
compare(byte[] raw1,
byte[] raw2,
java.util.Formatter f) |
static void |
compare(float[] raw1,
float[] raw2,
java.util.Formatter f) |
static int |
compare(int x,
int y) |
static int |
compare(long x,
long y) |
static java.util.List |
getList(java.lang.Iterable ii) |
static java.util.List<java.lang.String> |
getProtocols(java.lang.String url)
Return the set of leading protocols for a url; may be more than one.
|
static int |
getSize(java.lang.Iterable ii) |
static java.lang.String |
getTestdataDirPath() |
static double |
howClose(double d1,
double d2) |
static void |
main(java.lang.String[] args)
test
|
static java.lang.String |
showBytes(byte[] buff) |
static void |
showBytes(byte[] buff,
java.util.Formatter f) |
static java.lang.String |
showInts(int[] inta) |
static void |
showInts(int[] inta,
java.util.Formatter f) |
static java.lang.String |
showInts(java.util.List<java.lang.Integer> intList) |
protected static boolean |
validateprotocol(java.lang.String url,
int startpos,
int endpos) |
protected static final java.lang.String alpha
protected static final java.lang.String slashalpha
public static final int referenceSize
public static final int objectSize
public static final double maxReletiveError
public static double howClose(double d1, double d2)
public static boolean closeEnough(double v1, double v2, double maxRelDiff)
v1
- first floating point numberv2
- second floating point numbermaxRelDiff
- maximum reletive differencepublic static boolean closeEnough(double v1, double v2)
v1
- first floating point numberv2
- second floating point numberpublic static boolean closeEnough(float v1, float v2, float maxRelDiff)
public static boolean closeEnough(float v1, float v2)
v1
- first floating point numberv2
- second floating point numberpublic static boolean closeEnoughAbs(double v1, double v2, double maxAbsDiff)
v1
- first floating point numberv2
- second floating point numbermaxAbsDiff
- maximum absolute differencepublic static boolean closeEnoughAbs(float v1, float v2, float maxAbsDiff)
public static java.lang.String showInts(int[] inta)
public static java.lang.String showInts(java.util.List<java.lang.Integer> intList)
public static void showInts(int[] inta, java.util.Formatter f)
public static java.lang.String showBytes(byte[] buff)
public static void showBytes(byte[] buff, java.util.Formatter f)
public static int getSize(java.lang.Iterable ii)
public static java.util.List getList(java.lang.Iterable ii)
public static java.lang.String getTestdataDirPath()
public static boolean compare(byte[] raw1, byte[] raw2, java.util.Formatter f)
public static void compare(float[] raw1, float[] raw2, java.util.Formatter f)
public static int compare(int x, int y)
public static int compare(long x, long y)
public static java.util.List<java.lang.String> getProtocols(java.lang.String url)
url
- the url whose protocols to returnprotected static boolean validateprotocol(java.lang.String url, int startpos, int endpos)
public static void main(java.lang.String[] args)