public class MathTools extends java.lang.Object implements IMathTools
构造器和说明 |
---|
MathTools() |
限定符和类型 | 方法和说明 |
---|---|
double |
byteToMbitWithPattern(long byteValue,
java.lang.String pattern)
convert byte to Mbit
|
int |
convertToInt(java.lang.Object object,
int defaultValue)
转换为整型
|
long |
convertToLong(java.lang.Object object,
long defaultValue)
转换为长整型
|
java.lang.String |
floatRound2(double value) |
double |
formatDoubleWithPattern(double original,
java.lang.String pattern) |
java.lang.String |
formatSizeUnit(long size)
转换为流量或者存储单位
|
double |
getDistance(double lat1,
double lng1,
double lat2,
double lng2)
计算两个位置间的距离
|
static MathTools |
getInstance() |
double |
MbitToByteWithPattern(double Mbit,
java.lang.String pattern)
convert Mbit to byte
|
double |
round(double value,
int scale,
int roundingMode) |
public static MathTools getInstance()
public java.lang.String formatSizeUnit(long size)
formatSizeUnit
在接口中 IMathTools
size
- public double round(double value, int scale, int roundingMode)
round
在接口中 IMathTools
public int convertToInt(java.lang.Object object, int defaultValue)
convertToInt
在接口中 IMathTools
object
- defaultValue
- public long convertToLong(java.lang.Object object, long defaultValue)
convertToLong
在接口中 IMathTools
object
- defaultValue
- public double byteToMbitWithPattern(long byteValue, java.lang.String pattern)
byteToMbitWithPattern
在接口中 IMathTools
byteValue
- pattern
- public double MbitToByteWithPattern(double Mbit, java.lang.String pattern)
MbitToByteWithPattern
在接口中 IMathTools
Mbit
- pattern
- public java.lang.String floatRound2(double value)
floatRound2
在接口中 IMathTools
public double formatDoubleWithPattern(double original, java.lang.String pattern)
formatDoubleWithPattern
在接口中 IMathTools
public double getDistance(double lat1, double lng1, double lat2, double lng2)
getDistance
在接口中 IMathTools
lat1
- lng1
- lat2
- lng2
-