public abstract class Maths extends Object
构造器和说明 |
---|
Maths() |
限定符和类型 | 方法和说明 |
---|---|
static int |
bit(String s)
Convert a binary string to a integer
|
static int |
extract(int bs,
int low,
int high)
Get part of one integer as a new integer
|
static boolean |
isMask(int bs,
int mask)
Test current bit is match the given mask at least one bit or not.
|
static boolean |
isMaskAll(int bs,
int mask)
Test current bit is all match the give mask.
|
static boolean |
isNoMask(int bs,
int mask) |
static int |
max(int... nums)
返回最大的一个
|
static int |
min(int... nums)
返回最小的一个
|
static String[] |
permutation(char... arr)
获得字符数组的全排列
|
static String[] |
permutation(int length,
char... arr)
按照指定长度, 获得字符数组的全排列
|
public static int max(int... nums)
nums
- 需要比较的数组public static int min(int... nums)
nums
- 需要比较的数组public static int bit(String s)
s
- binary stringpublic static boolean isMask(int bs, int mask)
bs
- integer, bit mapmask
- another bit mappublic static boolean isNoMask(int bs, int mask)
public static boolean isMaskAll(int bs, int mask)
bs
- integer, bit mapmask
- another bit mappublic static int extract(int bs, int low, int high)
bs
- original integerlow
- the low bit position (inclusive), 0 basehigh
- the hight bit position (exclusive), 0 basepublic static String[] permutation(char... arr)
arr
- 字符数组public static String[] permutation(int length, char... arr)
arr
- 字符数组Copyright © 2017. All rights reserved.