package implemB;

public class NumeroTelephone {
	public static enum phoneType {
		unknown,
		portable,
		domicile,
		travail,
		fax
	};
	
	private phoneType type;
	private String    num;
	
	//:://////////////////////////////////////////////////////////////////////
	//::// Creators
	//:://////////////////////////////////////////////////////////////////////
	
	public NumeroTelephone(String num, phoneType type) {
		this.setType(type);
		this.setNum(num);
	}
	
	public NumeroTelephone(String num) {
		this(num, phoneType.unknown);
	}

	//:://////////////////////////////////////////////////////////////////////
	//::// Overloaded functions
	//:://////////////////////////////////////////////////////////////////////

	public boolean equals(Object o)
	{
		if(!(o instanceof NumeroTelephone))
			return false;
		
		return ((NumeroTelephone)o).getNum().equals(this.getNum());
	}
	
	public String toString()
	{
		return this.getNum();
	}
	
	//:://////////////////////////////////////////////////////////////////////
	//::// Getter, and setters
	//:://////////////////////////////////////////////////////////////////////
	
	public phoneType getType() {
		return type;
	}

	public void setType(phoneType type) {
		this.type = type;
	}

	public String getNum() {
		return num;
	}

	public void setNum(String num) {
		this.num = num;
	}
}
