-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBooks.java
More file actions
48 lines (35 loc) · 1.23 KB
/
Copy pathBooks.java
File metadata and controls
48 lines (35 loc) · 1.23 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
import java.util.*;
public class Books extends Collections {
protected String ISBN;
protected String author;
//set defaults and set type to book
public Books() {
super();
this.type = "Books";
this.ISBN = "0000000000000";
this.author = "Unknown Author";
}
public Books(String collectionID, String title, String ISBN) {
this();
this.collectionID = collectionID;
this.title = title;
this.ISBN = ISBN;
}
public Books(String collectionID, String title, String publisher, String genre, String ISBN,
String author, String type) {
super(collectionID, title, publisher, genre, type);
this.type = "Books";
this.ISBN = ISBN;
this.author = author;
}
public String getISBN() {
return this.ISBN;
}
public String getAuthor() {
return this.author;
}
//make into string to be used with SaveToFile.java
public String toString() {
return String.format("%s,%s,%s,%s,%s,%s,%s\n", this.getCollectionID(), this.getISBN(), this.getTitle(), this.getPublisher(), this.getGenre(), this.getAuthor(), this.getType());
}
}