Package opencard.opt.iso.fs
Class CardFileFileID
- java.lang.Object
-
- opencard.opt.iso.fs.CardFilePathComponent
-
- opencard.opt.iso.fs.CardFileFileID
-
public class CardFileFileID extends CardFilePathComponent
CardFileFileID contains a single CardFilePath component, a two byte file ID.- Author:
- Dirk Husemann (hud@zurich.ibm.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
fileID
Cache the two byte file ID for fast access-
Fields inherited from class opencard.opt.iso.fs.CardFilePathComponent
comp
-
-
Constructor Summary
Constructors Constructor Description CardFileFileID(byte hi, byte lo)
Instantiate a file ID path component.CardFileFileID(short fileID)
Instantiate a file ID path component.CardFileFileID(java.lang.String comp)
Instantiate a file ID path component.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object comp)
Compare two file ID components.int
hashCode()
Return a hashcode for this file ID componentbyte[]
toByteArray()
Return the byte array representing this component.void
toByteArray(byte[] bites, int off)
Fill in the byte array that represents this component.short
toShort()
Return the short representation of this component.-
Methods inherited from class opencard.opt.iso.fs.CardFilePathComponent
createComponent, toString
-
-
-
-
Constructor Detail
-
CardFileFileID
public CardFileFileID(java.lang.String comp)
Instantiate a file ID path component.- Parameters:
comp
- The String containing the path component.
-
CardFileFileID
public CardFileFileID(short fileID)
Instantiate a file ID path component.- Parameters:
fileID
- A short containing the file ID.
-
CardFileFileID
public CardFileFileID(byte hi, byte lo)
Instantiate a file ID path component.- Parameters:
hi
- The high byte of the fileID (e.g., 0xCA for :CAFE)lo
- The low byte of the fileID (e.g., 0xFE for :CAFE)
-
-
Method Detail
-
toShort
public short toShort()
Return the short representation of this component.- Returns:
- A short representing this component.
-
toByteArray
public byte[] toByteArray()
Return the byte array representing this component.- Returns:
- A byte array that represents this component.
-
toByteArray
public void toByteArray(byte[] bites, int off)
Fill in the byte array that represents this component.- Parameters:
bites
- The target byte array.off
- The offset into the target byte array.
-
equals
public boolean equals(java.lang.Object comp)
Compare two file ID components.- Overrides:
equals
in classCardFilePathComponent
- Parameters:
comp
- An object of type CardFileFileID.- Returns:
- True if comp is of type CardFilePathComponent and describes the same path component.
-
hashCode
public int hashCode()
Return a hashcode for this file ID component- Overrides:
hashCode
in classjava.lang.Object
-
-