-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.java
More file actions
98 lines (89 loc) · 1.76 KB
/
Copy pathBook.java
File metadata and controls
98 lines (89 loc) · 1.76 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/**
* Define properties of book
* @author Kelly Chen
* @version 0.1
* CSE 017 Project 1
* Date of creation: February 28, 2022
* Last Date Modified: March 1, 2022
*/
package Project1;
public class Book extends Titles{
//Data Member
protected String author;
protected String ISBN;
/**
* Default constructor
*/
public Book()
{
super();
}
/**
* Constructor with given inputs
* @param c call number to set
* @param t title to set
* @param p publisher to set
* @param y year to set
* @param copies to set
* @param a author to set
* @param i ISBN to set
*/
public Book(String c, String t, String p, int y, int copies, String a, String i)
{
super(c, t, p, y, copies);
author = a;
ISBN = i;
}
//Getter Methods
/**
* Getter for data member author
* @return data member author
*/
public String getAuthor()
{
return author;
}
/**
* Getter for data member ISBN
* @return data member ISBN
*/
public String getISBN()
{
return ISBN;
}
//Setter Methods
/**
* Setter for data member author
* @param a author to set
*/
public void setAuthor(String a)
{
author = a;
}
/**
* Setter for data member ISBN
* @param ISBN to set
*/
public void setISBN(String ISBN)
{
this.ISBN = ISBN;
}
/**
* Method to get the Book information
* @return formatted string containing the value of the data members
*/
@Override
public String toString()
{
return super.toString();
}
/**
* Method to get the Book information
* @return formatted string with each data member on its own line
*/
@Override
public String simpleString()
{
return super.simpleString() + "\nAuthor: " + author + "\nISBN: " + ISBN;
}
}