-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy pathConcert.java
More file actions
62 lines (54 loc) · 1.22 KB
/
Copy pathConcert.java
File metadata and controls
62 lines (54 loc) · 1.22 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*******************************************************************************
* Companion code for the book "Introduction to Software Design with Java"
* by Martin P. Robillard.
*
* Copyright (C) 2019 by Martin P. Robillard
*
* This code is licensed under a Creative Commons
* Attribution-NonCommercial-NoDerivatives 4.0 International License.
*
* See http://creativecommons.org/licenses/by-nc-nd/4.0/
*******************************************************************************/
package chapter7;
/**
* Represents a concert.
*/
public class Concert implements Show
{
private String aTitle;
protected String aPerformer;
private int aTime;
public Concert(String pTitle, String pPerformer, int pTime)
{
aTitle = pTitle;
aPerformer = pPerformer;
aTime = pTime;
}
public String getTitle()
{
return aTitle;
}
public void setTitle(String pTitle)
{
aTitle = pTitle;
}
@Override
public String title()
{
return aTitle;
}
@Override
public String description()
{
return String.format("%s by %s", aTitle, aPerformer);
}
@Override
public int time()
{
return aTime;
}
public void setTime(int pTime)
{
aTime = pTime;
}
}