Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package aplikacjabiblioteczna;
- //comparable -> alfabetyczne sortowanie wyników
- public class Book implements Comparable<Book> {
- private String author; //autor
- private String title; //tytuł
- private String publishment; //rok wydania
- private String number; //numer ewidencyjny
- private String house; //wydawnictwo
- public String toCSV() {
- return title + "; " + author + "; " + house + "; " + publishment + "; " + number;
- }
- Book(String string, String string0) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- public Book(String author, String title, String publishment, String number, String house) {
- this.author = author;
- this.title = title;
- this.publishment = publishment;
- this.number = number;
- this.house = house;
- }
- public String getAuthor() {
- return author;
- }
- public void setAuthor(String author) {
- this.author = author;
- }
- public String getTitle() {
- return title;
- }
- public void setTitle(String title) {
- this.title = title;
- }
- public String getPublishment() {
- return publishment;
- }
- public void setPublishment(String publishment) {
- this.publishment = publishment;
- }
- public String getNumber() {
- return number;
- }
- public void setNumber(String number) {
- this.number = number;
- }
- public String getHouse() {
- return house;
- }
- public void setHouse(String house) {
- this.house = house;
- }
- @Override
- public int compareTo(Book c) {
- return this.author.compareTo(c.author);
- }
- @Override
- public String toString() {
- return title + "; " + author + "; " + house + "; " + publishment + "; " + number;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement