package de.animux.android.andmal.api.anime; import de.animux.android.andmal.api.MalObject; public class Anime extends MalObject { private int id; private String title; private String synonyms; private int type; private int episodes; private int status; private String start; private String end; private String image; private int myId; private int watchedEpisodes; private String myStart; private String myEnd; private int myScore; private int myStatus; private int rewatching; private int rewatchingEpisodes; private int lastUpdate; private String tags; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getSynonyms() { return synonyms; } public void setSynonyms(String synonyms) { this.synonyms = synonyms; } public int getType() { return type; } public void setType(int type) { this.type = type; } public int getEpisodes() { return episodes; } public void setEpisodes(int episodes) { this.episodes = episodes; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public String getStart() { return start; } public void setStart(String start) { this.start = start; } public String getEnd() { return end; } public void setEnd(String end) { this.end = end; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public int getMyId() { return myId; } public void setMyId(int myId) { this.myId = myId; } public int getWatchedEpisodes() { return watchedEpisodes; } public void setWatchedEpisodes(int watchedEpisodes) { this.watchedEpisodes = watchedEpisodes; } public String getMyStart() { return myStart; } public void setMyStart(String myStart) { this.myStart = myStart; } public String getMyEnd() { return myEnd; } public void setMyEnd(String myEnd) { this.myEnd = myEnd; } public int getMyScore() { return myScore; } public void setMyScore(int myScore) { this.myScore = myScore; } public int getMyStatus() { return myStatus; } public void setMyStatus(int myStatus) { this.myStatus = myStatus; } public int getRewatching() { return rewatching; } public void setRewatching(int rewatching) { this.rewatching = rewatching; } public int getRewatchingEpisodes() { return rewatchingEpisodes; } public void setRewatchingEpisodes(int rewatchingEpisodes) { this.rewatchingEpisodes = rewatchingEpisodes; } public int getLastUpdate() { return lastUpdate; } public void setLastUpdate(int lastUpdate) { this.lastUpdate = lastUpdate; } public String getTags() { return tags; } public void setTags(String tags) { this.tags = tags; } @Override public String toString() { return getTitle(); } @Override public int compareTo(MalObject arg0) { if ( !(arg0 instanceof Anime)) { throw new IllegalArgumentException(); } Anime a = (Anime)arg0; int compareTitle = a.getTitle().compareTo(getTitle()); if (compareTitle != 0) { return compareTitle; } else { if (a.getId() != getId()) { return getId() - a.getId(); } } return 0; } @Override public String getProgress() { return getWatchedEpisodes() + "/" + getEpisodes(); } }