-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMusicEvent.java
More file actions
33 lines (23 loc) · 1.31 KB
/
MusicEvent.java
File metadata and controls
33 lines (23 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package project3;
import java.lang.String;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import project3.Event;
public class MusicEvent extends Event {
private String performers[];
private static ArrayList<Event> eventList = new ArrayList<Event>();
protected MusicEvent(String name, String place, Date dateTime, int audience, int cost, int revenue, int profit, String[] performers) throws ParseException {
super(name, place, dateTime, audience, cost, revenue, profit);
this.setPerformers(performers);
MusicEvent event = this;
MusicEvent.eventList.add(event);
} // MusicEvent()
public final void setPerformers(String[] performers) {this.performers = performers;}
public String[] getPerformers() {return this.performers;}
public static ArrayList getEventList() {return MusicEvent.eventList;} // static method, cannot be over-ridden
public static int getNumberOfObjects() {return MusicEvent.getEventList().size();} // static method, cannot be over-ridden
@Override // project2.Event.toString()
public String toString() {return super.toString() + " [performers = " + Arrays.toString(this.getPerformers()) + "]";}
} // class MusicEvent