import java.util.*;

public class SecurityDriver {
	public static void main(String[] args) {

		//We create a number of different objects based on our classes.
		Guest james = new Guest("James Foo", "S782359A", new MyDate(10, 12, 1987), "Visitor");
		Staff peter = new Staff("Peter Griffin", "G671234K", new MyDate(28, 2, 1976), "SVC1516");
		Vehicle peter_car = new Vehicle(peter, "AUDI RS3", "SG1688");
		Staff lim = new Staff("Lim Swee Teng", "S762345D", new MyDate(5, 7, 1971), "SVK7639");

		//Although we cannot instantiate securityClearance objects, ie. we cannot have SecurityClearance s = new Security(...);
		//We can use data structures and inheritence to do the same thing.
		SecurityClearance[] allSecurity = new SecurityClearance[4];
		//Note that they are all different classes...
		allSecurity[0] = james;
		allSecurity[1] = peter;
		allSecurity[2] = peter_car;
		allSecurity[3] = lim;
		
		//... yet you can simply call the implemented abstract functions
		for (int i = 0; i < allSecurity.length; i++) {
			allSecurity[i].issueClearance(new MyDate(1, 1, 2012));
		}

		//Here we fast forward 8 months and check how each of them are doing in their clearance. 
		//Guests expire, Staff doesn't need a renewal and Vehicles get a renewal.
		for (int i = 0; i < allSecurity.length; i++) {
				allSecurity[i].updateClearance(new MyDate(2,2,2012));
				System.out.println(allSecurity[i]);
		}
	}
}

