Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class GOTEpizoda implements OPoredivo {
- int sezona, epizoda, brojGledalaca;
- String naziv, reditelj;
- public GOTEpizoda() {
- sezona = 1;
- epizoda = 1;
- naziv = "Winter is coming";
- reditelj = "Tim Van Pattern"
- brojGledalaca = 2220000;
- }
- public GOTEpizoda(int sezona, int epizoda, int brojGledalaca, String naziv, String reditelj) {
- this.sezona = sezona;
- this.epizoda = epizoda;
- this.brojGledalaca = brojGledalaca;
- this.naziv = naziv;
- this.reditelj = reditelj;
- }
- GOTEpizoda(GOTEpizoda ep) {
- this.sezona = ep.sezona;
- this.epizoda = ep.epizoda;
- this.brojGledalaca = ep.brojGledalaca;
- this.naziv = ep.naziv;
- this.reditelj = ep.reditelj;
- }
- @Override
- public String toString() {
- return String.format("%s S%2d/E%2d %f - %s", naziv, sezona, epizoda, brojGledalaca/1000000, reditelj);
- }
- @Override
- public uporedi(Object t) {
- if(GOTEpizoda.brojGledalaca > t.brojGledalaca) {
- return true;
- } else if(GOTEpizoda.brojGledalaca < t.brojGledalaca) {
- return false;
- } else {
- return epizoda < t.epizoda;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement