2 * Copyright (C) 2012 Andrew Neal Licensed under the Apache License, Version 2.0
3 * (the "License"); you may not use this file except in compliance with the
4 * License. You may obtain a copy of the License at
5 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
6 * or agreed to in writing, software distributed under the License is
7 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 * KIND, either express or implied. See the License for the specific language
9 * governing permissions and limitations under the License.
12 package com.cyngn.eleven.model;
14 import android.text.TextUtils;
17 * A class that represents an artist.
19 * @author Andrew Neal (andrewdneal@gmail.com)
24 * The unique Id of the artist
26 public long mArtistId;
31 public String mArtistName;
34 * The number of albums for the artist
36 public int mAlbumNumber;
39 * The number of songs for the artist
41 public int mSongNumber;
44 * Constructor of <code>Artist</code>
46 * @param artistId The Id of the artist
47 * @param artistName The artist name
48 * @param songNumber The number of songs for the artist
49 * @param albumNumber The number of albums for the artist
51 public Artist(final long artistId, final String artistName, final int songNumber,
52 final int albumNumber) {
55 mArtistName = artistName;
56 mSongNumber = songNumber;
57 mAlbumNumber = albumNumber;
64 public int hashCode() {
67 result = prime * result + mAlbumNumber;
68 result = prime * result + (int) mArtistId;
69 result = prime * result + (mArtistName == null ? 0 : mArtistName.hashCode());
70 result = prime * result + mSongNumber;
78 public boolean equals(final Object obj) {
85 if (getClass() != obj.getClass()) {
88 final Artist other = (Artist)obj;
89 if (mAlbumNumber != other.mAlbumNumber) {
92 if (mArtistId != other.mArtistId) {
95 if (!TextUtils.equals(mArtistName, other.mArtistName)) {
98 if (mSongNumber != other.mSongNumber) {
108 public String toString() {