Please use java Part 2. Library Class Implement a class, Library, as described in the class diagram below. Library must implement the Comparable interface. The compareTo() method must compare the branch names and only the branch names. The comparison must be case insensitive. The equals() method must compare the branch names and only the branch names. The comparison must be case insensitive. Be sure to test the equals() and compareTo() methods before proceeding. Library - state: String - branch: String - city: String - zip: String - county: String - int squareFeet: int - int hoursOpen: int - int weeksOpen: int + Library(state: String, branch: String, city: String, zip: String, county: String, squareFeet: int, hoursOpen: int, weeksOpen: int) + getState(): String + getBranch(): String + getCity(): String + getZip(): String + getCounty(): String + getSquareFeet(): int + getHoursOpen(): int + getWeeksOpen(): int + setState(state: String): void + setBranch(branch: String):void + setCity(city: String):void + setZip(zip: String):void + setCounty(count: : String):void + setSquareFeet(sqfeet: int): void + setHoursOpen(hrsOpen: int): void + setWeeksOpen(weeksOpen: int): void + equals(Object obj): boolean + compareTo(Library): int + toString(): String
Please use java
Part 2. Library Class
- Implement a class, Library, as described in the class diagram below.
- Library must implement the Comparable interface.
- The compareTo() method must compare the branch names and only the branch names. The comparison must be case insensitive.
- The equals() method must compare the branch names and only the branch names. The comparison must be case insensitive.
- Be sure to test the equals() and compareTo() methods before proceeding.
Library |
- state: String - branch: String - city: String - zip: String - county: String - int squareFeet: int - int hoursOpen: int - int weeksOpen: int |
+ Library(state: String, branch: String, city: String, zip: String, county: String, squareFeet: int, hoursOpen: int, weeksOpen: int) + getState(): String + getBranch(): String + getCity(): String + getZip(): String + getCounty(): String + getSquareFeet(): int + getHoursOpen(): int + getWeeksOpen(): int + setState(state: String): void + setBranch(branch: String):void + setCity(city: String):void + setZip(zip: String):void + setCounty(count: : String):void + setSquareFeet(sqfeet: int): void + setHoursOpen(hrsOpen: int): void + setWeeksOpen(weeksOpen: int): void + equals(Object obj): boolean + compareTo(Library): int + toString(): String |
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 8 images