类 Misc
- java.lang.Object
-
- org.meteoinfo.ndarray.util.Misc
-
public class Misc extends java.lang.ObjectMiscellaneous static routines.- 作者:
- caron
-
-
字段概要
字段 修饰符和类型 字段 说明 protected static java.lang.Stringalphastatic doublemaxReletiveErrorstatic intobjectSizestatic intreferenceSizeprotected static java.lang.Stringslashalpha
-
构造器概要
构造器 构造器 说明 Misc()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static booleancloseEnough(double v1, double v2)Check if numbers are equal with default tolerancestatic booleancloseEnough(double v1, double v2, double maxRelDiff)Check if numbers are equal with given reletive tolerancestatic booleancloseEnough(float v1, float v2)Check if numbers are equal with default tolerancestatic booleancloseEnough(float v1, float v2, float maxRelDiff)static booleancloseEnoughAbs(double v1, double v2, double maxAbsDiff)Check if numbers are equal with given absolute tolerancestatic booleancloseEnoughAbs(float v1, float v2, float maxAbsDiff)static booleancompare(byte[] raw1, byte[] raw2, java.util.Formatter f)static voidcompare(float[] raw1, float[] raw2, java.util.Formatter f)static intcompare(int x, int y)static intcompare(long x, long y)static java.util.ListgetList(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 intgetSize(java.lang.Iterable ii)static java.lang.StringgetTestdataDirPath()static doublehowClose(double d1, double d2)static voidmain(java.lang.String[] args)teststatic java.lang.StringshowBytes(byte[] buff)static voidshowBytes(byte[] buff, java.util.Formatter f)static java.lang.StringshowInts(int[] inta)static voidshowInts(int[] inta, java.util.Formatter f)static java.lang.StringshowInts(java.util.List<java.lang.Integer> intList)protected static booleanvalidateprotocol(java.lang.String url, int startpos, int endpos)
-
-
-
字段详细资料
-
alpha
protected static final java.lang.String alpha
- 另请参阅:
- 常量字段值
-
slashalpha
protected static final java.lang.String slashalpha
- 另请参阅:
- 常量字段值
-
referenceSize
public static final int referenceSize
- 另请参阅:
- 常量字段值
-
objectSize
public static final int objectSize
- 另请参阅:
- 常量字段值
-
maxReletiveError
public static final double maxReletiveError
- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
howClose
public static double howClose(double d1, double d2)
-
closeEnough
public static boolean closeEnough(double v1, double v2, double maxRelDiff)Check if numbers are equal with given reletive tolerance- 参数:
v1- first floating point numberv2- second floating point numbermaxRelDiff- maximum reletive difference- 返回:
- true if within tolerance
-
closeEnough
public static boolean closeEnough(double v1, double v2)Check if numbers are equal with default tolerance- 参数:
v1- first floating point numberv2- second floating point number- 返回:
- true if within tolerance
-
closeEnough
public static boolean closeEnough(float v1, float v2, float maxRelDiff)
-
closeEnough
public static boolean closeEnough(float v1, float v2)Check if numbers are equal with default tolerance- 参数:
v1- first floating point numberv2- second floating point number- 返回:
- true if within tolerance
-
closeEnoughAbs
public static boolean closeEnoughAbs(double v1, double v2, double maxAbsDiff)Check if numbers are equal with given absolute tolerance- 参数:
v1- first floating point numberv2- second floating point numbermaxAbsDiff- maximum absolute difference- 返回:
- true if within tolerance
-
closeEnoughAbs
public static boolean closeEnoughAbs(float v1, float v2, float maxAbsDiff)
-
showInts
public static java.lang.String showInts(int[] inta)
-
showInts
public static java.lang.String showInts(java.util.List<java.lang.Integer> intList)
-
showInts
public static void showInts(int[] inta, java.util.Formatter f)
-
showBytes
public static java.lang.String showBytes(byte[] buff)
-
showBytes
public static void showBytes(byte[] buff, java.util.Formatter f)
-
getSize
public static int getSize(java.lang.Iterable ii)
-
getList
public static java.util.List getList(java.lang.Iterable ii)
-
getTestdataDirPath
public static java.lang.String getTestdataDirPath()
-
compare
public static boolean compare(byte[] raw1, byte[] raw2, java.util.Formatter f)
-
compare
public static void compare(float[] raw1, float[] raw2, java.util.Formatter f)
-
compare
public static int compare(int x, int y)
-
compare
public static int compare(long x, long y)
-
getProtocols
public 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. Watch out for Windows paths starting with a drive letter => protocol names must all have a length > 1. Watch out for '::' Each captured protocol is saved without trailing ':' Assume: the protocols MUST be terminated by the occurrence of '/'.- 参数:
url- the url whose protocols to return- 返回:
- list of leading protocols without the trailing :
-
validateprotocol
protected static boolean validateprotocol(java.lang.String url, int startpos, int endpos)
-
main
public static void main(java.lang.String[] args)
test
-
-