/**
 * Connection is basically a struct class which represents a Connection.
 */
class Connection {
	/**
	 * Type INPUT
	 * */
	static final int INPUT = 0;
	/**
	 * Type OUTPUT
	 * */
	static final int OUTPUT = 1;
	/**
	 * Type FILTER
	 * */
	static final int FILTER = 2;
	/**
	 * The id of the connection
	 * */
	int id;
	/**
	 * The name of the connection
	 * */
	String name;
	/**
	 * The type of the connection
	 * */
	int type;
	/**
	 * Default Constructor makes a Filter Connection
	 * */
	public Connection() {
		type = FILTER;
		setName("UnNamed");
	}
	/**
	 * Constructor makes a Filter Connection with a name
	 * @param connection the name of the connection
	 * */
	public Connection(String connection) {
		type = FILTER;
		setName(connection);
	}
	/**
	 * Constructor makes a  Connection of type type with a name
	 * @param type the type of the connection
	 * @param connection the name of the connection
	 * */
	public Connection(String connection,int type) {
		this.type = type;
		setName(connection);
	}
	/**
	 * Constructor makes a  Connection of type type with a name and id
	 * @param type the type of the connection
	 * @param connection the name of the connection
	 * @param id the id of the connection
	 * */
	public Connection(String connection,int type,int id) {
		this.type = type;
		this.id = id;
		setName(connection);
	}
	/**
	 * Sets the name of the constructor
	 * @param name the name to set
	 * */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * Gets the name of the connection
	 * @return String of the name
	 * */
	public String getName() {
		return name;
	}
	/**
	 * sets the type of the connection
	 * @param type the type to set
	 * */
	public void setType(int type) {
		this.type = type;
	}
	/**
	 * Gets the type of the connection
	 * @return int Type of the connection
	 * */
	public int getType() {
		return type;
	}
	/**
	 * sets the ID of the connection with id
	 * @param id the id to set.
	 * */
	public void setID(int id) {
		this.id = id;
	}
	/**
	 * Gets the ID of the connection
	 * @return int ID of the connection
	 * */
	public int getID() {
		return id;
	}
	/**
	 * Gets the ID of the connection
	 * @return int ID of the connection
	 * */
	public int getId() {
		return id;
	}
	/**
	 * equals object if object is a Connection and it has the same ID
	 * */
	public boolean equals(Object o) {
		return (o instanceof Connection && this.getID() == ((Connection)o).getID());
	}
}
