summaryrefslogtreecommitdiffstats
path: root/src/de/animux/android/andmal/api/anime/Anime.java
blob: dc4b34e9ec81c899fff8f3c6cd32fcf3c23e1924 (plain) (blame)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
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();
	}

}