import java.util.*;

//The staff has a permanent security clearance, 
public class Staff extends Person implements SecurityClearance {
	private String staffNumber;
	private MyDate startDate;
	private Boolean hasClearance = false;

	//Staff constructor, note that it does not need the occupation field
	//And requires a different staffNumber field
	//However, when you invoke the super constructor, you'll need to provide the default occupation
	public Staff(String name, String nric, MyDate birthday, String staffNumber) {
		super(name,nric,birthday,"Company Staff");
		setStaffNumber(staffNumber);
	}
	public void setStaffNumber(String staffNumber) {
		this.staffNumber = staffNumber;
	}

	public String getStaffNumber() {
		return this.staffNumber;
	}

	public boolean clearanceNotExpired() {
		return hasClearance;
	}

	//Company staff will have clearance as long as they are employed.
	public void updateClearance(MyDate currentDate) {
		return;
	}

	//A staff has a permananet clearance
	public void issueClearance(MyDate startDate) {
		this.startDate = startDate;
		hasClearance = true;
	}

	//Revokes the clearance, this removes the clearance completely. 
	//This function exists to complete the design, but is not used in our function.
	public void revokeClearance() {
		startDate = null;
		hasClearance = false;
	}

	//Since the staff has permanent clearance until revoked
	//This function is redundant. It also exists to complete the design.
	public void renewClearance(MyDate startDate) {
		return;
	}

	//Overriden method, this method is implicitly called when System.out.print(Staff) is called.
	public String toString() {
		if (clearanceNotExpired()) {
			return getName() + " has permanent clearance from " + startDate + ".";
		}
		else {
			return getName() + " no longer has any clearance.";
		}
	}

}

