📄 eanupc.java
字号:
// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov Date: 2007-11-23 16:17:26
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: EANUPC.java
package com.bokai.barcodes;
// Referenced classes of package com.bokai.barcodes:
// CharDef
class EANUPC
{
EANUPC()
{
}
static CharDef s_calcAdd2CharDef(CharDef achardef[][], byte abyte0[], char ac[], int i)
{
if(i < 0 && i >= -4)
{
i = -i - 1;
return achardef[0][i];
}
int j = (ac[0] - 48) * 10 + (ac[1] - 48);
byte byte0 = abyte0[j % 4];
if(i != 0 && i != 1)
return null;
if(i == 0)
j = (byte0 & 2) == 0 ? 0 : 1;
else
if(i == 1)
j = (byte0 & 1) == 0 ? 0 : 1;
return achardef[j][(ac[i] - 48) + 5];
}
static CharDef s_calcAdd5CharDef(CharDef achardef[][], byte abyte0[], char ac[], int i)
{
if(i < 0 && i >= -4)
{
i = -i - 1;
return achardef[0][i];
}
int k = ((((ac[4] - 48) + ac[2]) - 48) + ac[0]) - 48;
k *= 3;
k += 9 * (((ac[3] - 48) + ac[1]) - 48);
k %= 10;
byte byte0 = abyte0[k];
if(i < 0 || i > 4)
{
return null;
} else
{
int j = (byte0 & 1 << 4 - i) == 0 ? 0 : 1;
return achardef[j][(ac[i] - 48) + 5];
}
}
static CharDef s_calcCharDef(CharDef achardef[][], byte abyte0[], char ac[], int i)
{
if(i == 0)
return null;
if(i < 0 && i >= -3)
{
i = -i - 1;
return achardef[0][i];
}
byte byte0;
if(i >= 7)
{
byte0 = 2;
} else
{
byte byte1 = abyte0[ac[0] - 48];
byte0 = ((byte)((byte1 & 1 << 6 - i) == 0 ? 0 : 1));
}
return achardef[byte0][(ac[i] - 48) + 5];
}
static char s_calcCheckChar(char ac[], int i)
{
int l = 0;
for(int j = 11; j >= 1; j -= 2)
l += ac[j] - 48;
int i1 = 3 * l;
int j1 = 0;
for(int k = 10; k >= 0; k -= 2)
j1 += ac[k] - 48;
int k1 = i1 + j1;
int l1 = 10 - k1 % 10;
return (char)(l1 != 10 ? l1 + 48 : 48);
}
static final CharDef _chardef_eana[] = {
new CharDef(3, 17), new CharDef(5, 68), new CharDef(3, 17), new CharDef(0, 0), new CharDef(0, 0), new CharDef('0', 81), new CharDef('1', 321), new CharDef('2', 261), new CharDef('3', 1361), new CharDef('4', 1029),
new CharDef('5', 1281), new CharDef('6', 1109), new CharDef('7', 1349), new CharDef('8', 1301), new CharDef('9', 69)
};
static final CharDef _chardef_eanb[] = {
new CharDef(3, 17), new CharDef(5, 68), new CharDef(3, 17), new CharDef(0, 0), new CharDef(0, 0), new CharDef('0', 1045), new CharDef('1', 1285), new CharDef('2', 325), new CharDef('3', 1025), new CharDef('4', 337),
new CharDef('5', 1345), new CharDef('6', 17), new CharDef('7', 257), new CharDef('8', 65), new CharDef('9', 277)
};
static final CharDef _chardef_eanc[] = {
new CharDef(3, 17), new CharDef(5, 68), new CharDef(3, 17), new CharDef(0, 0), new CharDef(0, 0), new CharDef('0', 5380), new CharDef('1', 5140), new CharDef('2', 5200), new CharDef('3', 4100), new CharDef('4', 4432),
new CharDef('5', 4180), new CharDef('6', 4352), new CharDef('7', 4112), new CharDef('8', 4160), new CharDef('9', 5392)
};
static final byte _ean_sel[] = {
0, 11, 13, 14, 19, 25, 28, 21, 22, 26
};
static final CharDef _chardef_add2a[] = {
new CharDef(4, 69), new CharDef(0, 0), new CharDef(0, 0), new CharDef(2, 1), new CharDef(0, 0), new CharDef('0', 81), new CharDef('1', 321), new CharDef('2', 261), new CharDef('3', 1361), new CharDef('4', 1029),
new CharDef('5', 1281), new CharDef('6', 1109), new CharDef('7', 1349), new CharDef('8', 1301), new CharDef('9', 69)
};
static final CharDef _chardef_add2b[] = {
new CharDef(4, 69), new CharDef(0, 0), new CharDef(0, 0), new CharDef(2, 1), new CharDef(0, 0), new CharDef('0', 1045), new CharDef('1', 1285), new CharDef('2', 325), new CharDef('3', 1025), new CharDef('4', 337),
new CharDef('5', 1345), new CharDef('6', 17), new CharDef('7', 257), new CharDef('8', 65), new CharDef('9', 277)
};
static final byte _add2_sel[] = {
0, 1, 2, 3
};
static final byte _add5_sel[] = {
24, 20, 18, 17, 12, 6, 3, 10, 9, 5
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -