com.licel.jcardsim.samples.JavaPurseCrypto
Class CyclicFile

java.lang.Object
  extended by com.licel.jcardsim.samples.JavaPurseCrypto.CyclicFile

public class CyclicFile
extends Object

Class CyclicFile implements ISO 7816 CyclicFile. This class always allocates one more record than the maximum number of allowed records in CyclicFile. Method getNewLogRecord returns a new record without affecting contents of CyclicFile. Method updateNewLogRecord updates the internal record pointers, so the new record becomes the current record(record number one) and the oldest record becomes the next new record.


Constructor Summary
CyclicFile(byte max_record, byte record_length)
          Constructor
 
Method Summary
 byte findRecord(byte firstByte)
          Find the record.
 byte[] getNewLogRecord()
          Get a new record
 byte[] getRecord(byte recordNum)
          Get a record with the specified record number
 void updateNewLogRecord()
          Update internal record pointers, so the new record becomes the current record and the oldest record in CyclicFile becomes the next new record
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CyclicFile

public CyclicFile(byte max_record,
                  byte record_length)
Constructor

Parameters:
max_record - maximum number of record in CyclicFile
record_length - record length
Method Detail

getRecord

public byte[] getRecord(byte recordNum)
Get a record with the specified record number

Parameters:
recordNum - record number
Returns:
the specified record

findRecord

public byte findRecord(byte firstByte)
Find the record.

Parameters:
firstByte - if non-0, the record's first byte must match this value; if 0, any value of the record's first byte matches.
Returns:
the record number, or 0 if the record is not found

getNewLogRecord

public byte[] getNewLogRecord()
Get a new record

Returns:
the new record

updateNewLogRecord

public void updateNewLogRecord()
Update internal record pointers, so the new record becomes the current record and the oldest record in CyclicFile becomes the next new record

See Also:
getNewLogRecord