Java Utililty Methods Zero Format

List of utility methods to do Zero Format

Description

The list of methods to do Zero Format are organized into topic(s).

Method

intzeroConvert(String src)
zero Convert
if (src == null || src.equals("null") || "".equals(src) || " ".equals(src))
    return 0;
else
    return Integer.parseInt(src.trim());
intzerocount(int v)
Return the number of zeros in the binary representation of the value of the argument.
return bytezeros[v & 0xFF] + bytezeros[(v >> 8) & 0xFF] + bytezeros[(v >> 16) & 0xFF]
        + bytezeros[(v >> 24) & 0xFF];
intzeroCount(long n)
zero Count
long k;
int count = 63;
if (n == 0) {
    return 64;
k = n << 32;
if (k != 0) {
    count -= 32;
...
doublezeroDiv(double numerator, double denominator)
Returns the division or zero if the denominator is zero.
return (denominator == 0 ? 0 : numerator / denominator);
intzeroes(final int ch)
Returns the zero base for the specified code point, or -1 .
for (final int z : ZEROES)
    if (ch >= z && ch <= z + 9)
        return z;
return -1;
StringzeroEsquerda(String s1, int tamString)
zero Esquerda
while (s1.length() < tamString) {
    s1 = "0" + s1;
return s1;
longzeroExtend(long value, int inputBits)
Zero extend an integer.
if (inputBits < 64) {
    return value & ~(-1L << inputBits);
} else {
    return value;
voidzeroFill(float[] array)
This method fills the given array of floats with zeros.
for (int counter = 0; counter < array.length; counter++) {
    array[counter] = 0.0f;
StringzeroFill(int iv, int len)
zero Fill
String v = String.valueOf(iv);
if (v.length() < len) {
    StringBuilder bd = new StringBuilder(v);
    for (int i = 0; i < len - v.length(); i++) {
        bd.insert(0, '0');
    return bd.toString();
} else {
...
StringzeroFill(int num, int size, String character)
Takes the number num, and displays it with size digits.
StringBuilder res = new StringBuilder();
String snum = "" + num;
for (int i = snum.length(); i < size; i++) {
    res.append(character);
res.append(snum);
return res.toString().substring(res.length() - size);