import java.net.SocketAddress;

/**
 * @author Julien Vermillard
 * a serial port address
 * defined by it name and parameters (bauds, data bits, stop bits and parity)
 */
public class SerialSocketAddress extends SocketAddress {

	/**
	 * Default <code>serialVersionUID</code>
	 */
	private static final long serialVersionUID = 1L;
	
	private String name;
	private int bauds;
	private int dataBits;
	private int stopBits;
	private int parity;
	

	/**
	 * @param name port name (OS identifiant)
	 * @param bauds baud rate
	 * @param dataBits amount of data bits
	 * @param stopBits stop bits
	 * @param parity parity check
	 * @see javax.comm.SerialPort for constants
	 */
	public SerialSocketAddress(String name, int bauds, int dataBits, int stopBits,
			int parity) {
		super();
		this.name = name;
		this.bauds = bauds;
		this.dataBits = dataBits;
		this.stopBits = stopBits;
		this.parity = parity;
	}
	/**
	 * @return Returns the bauds.
	 */
	public int getBauds() {
		return bauds;
	}
	/**
	 * @return Returns the dataBits.
	 */
	public int getDataBits() {
		return dataBits;
	}
	/**
	 * @return Returns the name.
	 */
	public String getName() {
		return name;
	}
	/**
	 * @return Returns the parity.
	 */
	public int getParity() {
		return parity;
	}
	/**
	 * @return Returns the stopBits.
	 */
	public int getStopBits() {
		return stopBits;
	}
}
