⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ean128.java

📁 遗传算法改进神经网络源程序 该小程序可以添加条形码功能到你的网页或者applet上,这个applet把大写字母和数字转换为标准的条形码。
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov  Date: 2007-11-23 16:17:25
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   EAN128.java

package com.bokai.barcodes;


// Referenced classes of package com.bokai.barcodes:
//            BarcodeSpec, Barcode, CharDef, IntRef

abstract class EAN128 extends BarcodeSpec
{

    EAN128()
    {
    }

    static int _BC128(int i, int j, int k, int l, int i1, int j1)
    {
        return j1 - 1 << 1 | i1 - 1 << 4 | 8 | l - 1 << 7 | k - 1 << 10 | 0x200 | j - 1 << 13 | i - 1 << 16 | 0x8000;
    }

    static int _BC128_7(int i, int j, int k, int l, int i1, int j1, int k1)
    {
        return k1 - 1 << 1 | 1 | j1 - 1 << 4 | i1 - 1 << 7 | 0x40 | l - 1 << 10 | k - 1 << 13 | 0x1000 | j - 1 << 16 | i - 1 << 19 | 0x40000;
    }

    static CharDef s_C128CharDef(int i, CharDef achardef[][], char ac[], int j, int k)
    {
        IntRef intref = new IntRef();
        if(k < -5 || k >= ac.length - j)
            return null;
        if(k < 0 && k >= -5)
        {
            k = -k - 1;
            return achardef[i][k];
        }
        int l = s_C128QueryCharSet(i, ac, j, ac.length - j, k, intref);
        if(l == -1)
            return null;
        char c = ac[j + k];
        if((c & 0x80) != 0)
        {
            c &= '\uFF7F';
            return achardef[0][c + 5];
        }
        switch(l)
        {
        default:
            break;

        case 0: // '\0'
            if(c <= '\037')
                return achardef[0][c + 5 + 64];
            if(c <= '_')
                return achardef[0][(c - 32) + 5];
            break;

        case 1: // '\001'
            if(c >= ' ' && c <= '\177')
                return achardef[1][(c - 32) + 5];
            break;

        case 2: // '\002'
            if(intref.value != 0)
                return null;
            char c1 = ac[j + k + 1];
            if(j + k + 1 == ac.length - 1)
                return null;
            else
                return achardef[2][(c - 48) * 10 + (c1 - 48) + 5];
        }
        return null;
    }

    static char s_C128CheckChar(int i, boolean flag, char ac[], int j, int k)
    {
        int j1 = 0;
        IntRef intref = new IntRef();
        if(i == 0)
            j1 += 103;
        else
        if(i == 1)
            j1 += 104;
        else
        if(i == 2)
            j1 += 105;
        int i1 = 1;
        if(flag)
        {
            j1 += 102 * i1;
            i1++;
        }
        for(int l = 0; l < k; l++)
        {
            char c = ac[l + j];
            if((c & 0x80) != 0)
            {
                c &= '\uFF7F';
                j1 += c * i1;
                i1++;
            } else
            {
                int k1 = s_C128QueryCharSet(i, ac, j, k, l, intref);
                if(k1 == 0)
                {
                    if(c <= '\037')
                        j1 += (c + 64) * i1;
                    else
                    if(c <= '_')
                        j1 += (c - 32) * i1;
                    i1++;
                } else
                if(k1 == 1)
                {
                    j1 += (c - 32) * i1;
                    i1++;
                } else
                if(k1 == 2 && intref.value == 0)
                {
                    j1 += ((ac[l + j] - 48) * 10 + (ac[l + 1 + j] - 48)) * i1;
                    i1++;
                }
            }
        }

        return (char)(j1 % 103 + 128);
    }

    static int s_C128QueryCharSet(int i, char ac[], int j, int k, int l, IntRef intref)
    {
        int i1 = i;
        int k1 = i1;
        boolean flag = false;
        int i2 = ((flag) ? 1 : 0);
        boolean flag1 = false;
        for(int j2 = 0; j2 < l; j2++)
        {
            if(j2 == k)
                return -1;
            int j1 = k1;
            if(flag1)
                k1 = k1 != 0 ? 0 : 1;
            flag1 = false;
            int l1 = i2;
            char c = ac[j + j2];
            if((c & 0x80) != 0)
            {
                c &= '\uFF7F';
                switch(j1)
                {
                case 0: // '\0'
                    if(c == 'b')
                    {
                        k1 = 1;
                        flag1 = true;
                    } else
                    if(c == 'c')
                    {
                        k1 = 2;
                        i2 = 0;
                    } else
                    if(c == 'd')
                        k1 = 1;
                    break;

                case 1: // '\001'
                    if(c == 'b')
                    {
                        k1 = 0;
                        flag1 = true;
                    } else
                    if(c == 'c')
                    {
                        k1 = 2;
                        i2 = 0;
                    } else

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -