package calendar; import java.util.Calendar; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * This class creates a Birthday Event * * @author Adam Jama */ public class BirthdayEvent extends Event { private int m_guests; /** * This get the guests attending event * @return guests */ public int GetGuests() { return m_guests; } public static final int NO_FIELDS = 8; public static final int IDX_GUESTS = 7; /** * This set the guet attending event * @param guests */ public void SetGuests(int guests) { m_guests = guests; } /** * super inherits the event class * @throws Exception */ public BirthdayEvent(int id, String title, Calendar start_date, Calendar end_date, String description, int guests) throws Exception { super(id, title, start_date, end_date, description, Event.REPEATING_YEARLY); m_guests = guests; m_type = Event.BIRTHDAY_EVENT; } public BirthdayEvent() { super(); m_guests = 0; m_type = Event.BIRTHDAY_EVENT; } /** * This sends event to CSV File */ @Override public String ToCSV() { String csv = super.ToCSV() + ","+m_guests; return csv; } public static void main (String[] args){ BirthdayEvent jama = new BirthdayEvent(); BirthdayEvent hammed = new BirthdayEvent(); jama.SetGuests(10); hammed.SetGuests(4); System.out.println(jama.GetGuests()); System.out.println(hammed.GetGuests()); } }