📄 tjoidentry.java
字号:
/**
* Title: Linearfix file
*
* Project: Universal Application Specification v1.0 for PBOCv2
*
* Copyright: Copyright (c) CUP 2005
* Company: China Unionpay Co., Ltd
*
* Platform : Java virtual machine
* Language : 1.3.0-C
* Devl tool : Borland (c) JBuilder 4.0 *
* author : Meng Hongwen<hwmeng@chinaunionpay.com>
* version 1.0
*/
package cupUAPP;
import javacard.framework.*;
public class tjoidEntry {
private byte[] appoid = new byte[16];
private short oidlen;
public tAObject[] mObjectList;
public short usCount;
public boolean used;
// state machine: (id + loc + RAC + canRef + status) x ct_keyobjects;
public byte[] statemcachine = new byte[80];// MAX 16 key object in one app
public short usSMCount;
public tjoidEntry(byte[] poid, short olen ) {
Util.arrayCopyNonAtomic(poid,(short)0,appoid,(short)0,olen);
oidlen = olen;
used = true;
mObjectList = new tAObject[constdef.ct_objects_num];
usCount = (short)0;
usSMCount = usCount;
}
//------------------------------------------------
public void reset()
{
for(short i=(short)0; i< usSMCount; i++ )
statemcachine[(short)(5*i+4)] = (byte)0x0ff;
}
//------------------------------------------------
public boolean isEqual(byte[] pOid,short ol )
{
if ( usCount == (short)0 ) return false;
if ( Util.arrayCompare(appoid,(short)0,pOid,(short)0,ol)==(byte)0) return true;
return false;
}
//------------------------------------------------
public boolean isMyObject(byte[] pOid )
{
if ( Util.arrayCompare(appoid,(short)0,pOid,(short)0,(short)(oidlen-1))==(byte)0) return true;
return false;
}
//------------------------------------------------
public void setOid(byte[] poid, short olen )
{
Util.arrayCopyNonAtomic(poid,(short)0,appoid,(short)0,olen);
oidlen = olen;
used = true;
usSMCount = (short)0;
//usCount = (short)0; // should be zero
reset();
// all entry has be freed
}
//------------------------------------------------
public tAObject isExistObject( byte id)
{
for(short i=(short)0; i<constdef.ct_objects_num; i++ ) {
if ( mObjectList[i] != null ) {
if (mObjectList[i].used && mObjectList[i].oid == id ) return mObjectList[i];
}
}
return null;
}
//------------------------------------------------
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -