<commit_before>package tuwien.inso.mnsa.nokiaprovider.intern;

import java.io.IOException;

import javax.smartcardio.ATR;
import javax.smartcardio.CommandAPDU;
import javax.smartcardio.ResponseAPDU;

@SuppressWarnings("restriction")
public interface Connection {

	void connect() throws IOException;

	void disconnect();

	boolean isConnected();
	
	boolean isCardPresent() throws IOException;

	ResponseAPDU transceive(CommandAPDU capdu) throws IOException;

	ATR getATR() throws IOException;

	String getName();

}<commit_msg>added comments to interface Connection (nokiacardterminal)<commit_after>package tuwien.inso.mnsa.nokiaprovider.intern;

import java.io.IOException;

import javax.smartcardio.ATR;
import javax.smartcardio.CommandAPDU;
import javax.smartcardio.ResponseAPDU;

@SuppressWarnings("restriction")
public interface Connection {

	/**
	 * Establishes this connection. does nothing if the connection is already established.
	 * 
	 * @return
	 * @throws IOException
	 */
	void connect() throws IOException;

	/**
	 * Closes this connection. does nothing if the connection is already closed.
	 * 
	 * @return
	 * @throws IOException
	 */
	void disconnect();

	/**
	 * Returns true if this connection is open
	 * 
	 * @return
	 * @throws IOException
	 */
	boolean isConnected();

	/**
	 * Returns true if there has been a card present and no communication error happened since then and the connection has not been closed.
	 * 
	 * @throws IOException
	 */
	boolean isCardPresent() throws IOException;

	/**
	 * Sends an APDU to the card and returns the response.
	 * 
	 * @return
	 * @throws IOException
	 *             if no card is present or some communication error occurred.
	 */
	ResponseAPDU transceive(CommandAPDU capdu) throws IOException;

	/**
	 * Gets the ATR.
	 * 
	 * @return
	 * @throws IOException
	 */
	ATR getATR() throws IOException;

	/**
	 * Returns the unique name of this connection.
	 * 
	 * @return
	 */
	String getName();

}
{'fraction_non_alphanumeric': 0.09215885947046844, 'fraction_numerical': 0.0, 'mean_word_length': 3.9002493765586035, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3320303', 'n_tokens_mistral': 599, 'n_tokens_neox': 537, 'n_words': 179}