// Path: src/at/zweng/bankomatinfos/util/Utils.java
// public static String bytesToHex(byte[] bytes) {
// 	final char[] hexArray = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
// 			'9', 'A', 'B', 'C', 'D', 'E', 'F' };
// 	char[] hexChars = new char[bytes.length * 2];
// 	int v;
// 	for (int j = 0; j < bytes.length; j++) {
// 		v = bytes[j] & 0xFF;
// 		hexChars[j * 2] = hexArray[v >>> 4];
// 		hexChars[j * 2 + 1] = hexArray[v & 0x0F];
// 	}
// 	return new String(hexChars);
// }
// 
// Path: src/at/zweng/bankomatinfos/util/Utils.java
// public static String formatBalance(long balance) {
// 	if (balance < 100) {
// 		return "0,"
// 				+ String.format(Locale.GERMANY, "%02d",
// 						Long.valueOf(balance % 100L));
// 	}
// 	String format;
// 	format = "%,d";
// 	// format = "%d";
// 	return String.format(Locale.GERMANY, format, (balance / 100L))
// 			+ ","
// 			+ String.format(Locale.GERMANY, "%02d",
// 					Long.valueOf(balance % 100L));
// }


import static at.zweng.bankomatinfos.util.Utils.bytesToHex;
import static at.zweng.bankomatinfos.util.Utils.formatBalance;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import android.content.Context;
import at.zweng.bankomatinfos2.R;

package at.zweng.bankomatinfos.model;




/**
 * Represents the data read from a bankomat card.
 * 
 * @author Johannes Zweng <johannes@zweng.at>
 */
public class CardInfo {

	private byte[] _nfcTagId;
	private boolean _quickCard;
	private boolean _maestroCard;
	private boolean _containsTxLogs;
	private boolean _visaCard;
	private boolean _masterCard;
	private long _quickBalance;
	private int _pinRetryCounter;
	private String _quickCurrency;
	private Context _ctx;

	private List<QuickTransactionLogEntry> _quickLog;
	private List<EmvTransactionLogEntry> _transactionLog;
	private List<InfoKeyValuePair> _infoKeyValuePairs;

	/**
	 * Constructor
	 */
	public CardInfo(Context ctx) {
		// create empty list
		this._transactionLog = new ArrayList<EmvTransactionLogEntry>();
		this._quickLog = new ArrayList<QuickTransactionLogEntry>();
		this._infoKeyValuePairs = new ArrayList<InfoKeyValuePair>();
		this._pinRetryCounter = -1;
		this._quickCurrency = "<unknown, or parsing error>";
		this._ctx = ctx;
	}

	/**
	 * @return the _nfcTagId
	 */
	public byte[] getNfcTagId() {
		return _nfcTagId;
	}

	/**
	 * @param _nfcTagId
	 *            the _nfcTagId to set
	 */
	public void setNfcTagId(byte[] nfcTagId) {
		this._nfcTagId = nfcTagId;

// Path: src/at/zweng/bankomatinfos/util/Utils.java
// public static String bytesToHex(byte[] bytes) {
// 	final char[] hexArray = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
// 			'9', 'A', 'B', 'C', 'D', 'E', 'F' };
// 	char[] hexChars = new char[bytes.length * 2];
// 	int v;
// 	for (int j = 0; j < bytes.length; j++) {
// 		v = bytes[j] & 0xFF;
// 		hexChars[j * 2] = hexArray[v >>> 4];
// 		hexChars[j * 2 + 1] = hexArray[v & 0x0F];
// 	}
// 	return new String(hexChars);
// }
// 
// Path: src/at/zweng/bankomatinfos/util/Utils.java
// public static String formatBalance(long balance) {
// 	if (balance < 100) {
// 		return "0,"
// 				+ String.format(Locale.GERMANY, "%02d",
// 						Long.valueOf(balance % 100L));
// 	}
// 	String format;
// 	format = "%,d";
// 	// format = "%d";
// 	return String.format(Locale.GERMANY, format, (balance / 100L))
// 			+ ","
// 			+ String.format(Locale.GERMANY, "%02d",
// 					Long.valueOf(balance % 100L));
// }


// Path: src/at/zweng/bankomatinfos/model/CardInfo.java
import static at.zweng.bankomatinfos.util.Utils.bytesToHex;
import static at.zweng.bankomatinfos.util.Utils.formatBalance;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import android.content.Context;
import at.zweng.bankomatinfos2.R;

package at.zweng.bankomatinfos.model;




/**
 * Represents the data read from a bankomat card.
 * 
 * @author Johannes Zweng <johannes@zweng.at>
 */
public class CardInfo {

	private byte[] _nfcTagId;
	private boolean _quickCard;
	private boolean _maestroCard;
	private boolean _containsTxLogs;
	private boolean _visaCard;
	private boolean _masterCard;
	private long _quickBalance;
	private int _pinRetryCounter;
	private String _quickCurrency;
	private Context _ctx;

	private List<QuickTransactionLogEntry> _quickLog;
	private List<EmvTransactionLogEntry> _transactionLog;
	private List<InfoKeyValuePair> _infoKeyValuePairs;

	/**
	 * Constructor
	 */
	public CardInfo(Context ctx) {
		// create empty list
		this._transactionLog = new ArrayList<EmvTransactionLogEntry>();
		this._quickLog = new ArrayList<QuickTransactionLogEntry>();
		this._infoKeyValuePairs = new ArrayList<InfoKeyValuePair>();
		this._pinRetryCounter = -1;
		this._quickCurrency = "<unknown, or parsing error>";
		this._ctx = ctx;
	}

	/**
	 * @return the _nfcTagId
	 */
	public byte[] getNfcTagId() {
		return _nfcTagId;
	}

	/**
	 * @param _nfcTagId
	 *            the _nfcTagId to set
	 */
	public void setNfcTagId(byte[] nfcTagId) {
		this._nfcTagId = nfcTagId;

		this.addKeyValuePair(new InfoKeyValuePair(_ctx.getResources()
