Java Zero Format zeroes(final int ch)

Here you can find the source of zeroes(final int ch)

Description

Returns the zero base for the specified code point, or -1 .

License

BSD License

Parameter

Parameter Description
ch character

Return

zero base

Declaration

static int zeroes(final int ch) 

Method Source Code

//package com.java2s;
/**//from  w w  w.ja v  a2 s. c o m
 * This class assembles methods and variables that are used by more than one
 * formatter class.
 *
 * @author BaseX Team 2005-17, BSD License
 * @author Christian Gruen
 */

public class Main {
    /** Zero digits, Unicode Category Nd. */
    private static final int[] ZEROES = { 0x30, 0x660, 0x6F0, 0x7C0, 0x966, 0x9E6, 0xA66, 0xAE6, 0xB66, 0xBE6,
            0xC66, 0xCE6, 0xD66, 0xE50, 0xED0, 0xF20, 0x1040, 0x1090, 0x17E0, 0x1810, 0x1946, 0x19D0, 0x1A80,
            0x1A90, 0x1B50, 0x1BB0, 0x1C40, 0x1C50, 0xA620, 0xA8D0, 0xA900, 0xA9D0, 0xAA50, 0xABF0, 0xFF10, 0x104A0,
            0x11066, 0x1D7CE, 0x1D7D8, 0x1D7E2, 0x1D7EC, 0x1D7F6 };

    /**
     * Returns the zero base for the specified code point, or {@code -1}.
     * @param ch character
     * @return zero base
     */
    static int zeroes(final int ch) {
        for (final int z : ZEROES)
            if (ch >= z && ch <= z + 9)
                return z;
        return -1;
    }
}

Related

  1. zeroBlock(byte[] block, int off, int len)
  2. zeroConvert(String src)
  3. zerocount(int v)
  4. zeroCount(long n)
  5. zeroDiv(double numerator, double denominator)
  6. zeroEsquerda(String s1, int tamString)
  7. zeroExtend(long value, int inputBits)
  8. zeroFill(float[] array)
  9. zeroFill(int iv, int len)