// Path: app/src/main/java/github/daneren2005/dsub/domain/Genre.java
// public class Genre implements Serializable {
// 	private String name;
//     private String index;
// 	private Integer albumCount;
// 	private Integer songCount;
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
//     
//     public String getIndex() {
//         return index;
//     }
// 
//     public void setIndex(String index) {
//         this.index = index;
//     }
//     
//     @Override
//     public String toString() {
//         return name;
//     }
// 
// 	public Integer getAlbumCount() {
// 		return albumCount;
// 	}
// 
// 	public void setAlbumCount(Integer albumCount) {
// 		this.albumCount = albumCount;
// 	}
// 
// 	public Integer getSongCount() {
// 		return songCount;
// 	}
// 
// 	public void setSongCount(Integer songCount) {
// 		this.songCount = songCount;
// 	}
// 
// 	public static class GenreComparator implements Comparator<Genre> {
// 		@Override
// 		public int compare(Genre genre1, Genre genre2) {
// 			String genre1Name = genre1.getName() != null ? genre1.getName() : "";
// 			String genre2Name = genre2.getName() != null ? genre2.getName() : "";
// 
// 			return genre1Name.compareToIgnoreCase(genre2Name);
// 		}
// 
// 		public static List<Genre> sort(List<Genre> genres) {
// 			Collections.sort(genres, new GenreComparator());
// 			return genres;
// 		}
// 
// 	}
// }


import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.text.Html;
import android.util.Log;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.Genre;
import github.daneren2005.dsub.util.ProgressListener;
import org.xmlpull.v1.XmlPullParser;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
/*
 This file is part of Subsonic.

 Subsonic is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 Subsonic is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with Subsonic.  If not, see <http://www.gnu.org/licenses/>.

 Copyright 2010 (C) Sindre Mehus
 */
package github.daneren2005.dsub.service.parser;




/**
 * @author Joshua Bahnsen
 */
public class GenreParser extends AbstractParser {
	private static final String TAG = GenreParser.class.getSimpleName();
	
    public GenreParser(Context context, int instance) {
		super(context, instance);
	}

// Path: app/src/main/java/github/daneren2005/dsub/domain/Genre.java
// public class Genre implements Serializable {
// 	private String name;
//     private String index;
// 	private Integer albumCount;
// 	private Integer songCount;
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
//     
//     public String getIndex() {
//         return index;
//     }
// 
//     public void setIndex(String index) {
//         this.index = index;
//     }
//     
//     @Override
//     public String toString() {
//         return name;
//     }
// 
// 	public Integer getAlbumCount() {
// 		return albumCount;
// 	}
// 
// 	public void setAlbumCount(Integer albumCount) {
// 		this.albumCount = albumCount;
// 	}
// 
// 	public Integer getSongCount() {
// 		return songCount;
// 	}
// 
// 	public void setSongCount(Integer songCount) {
// 		this.songCount = songCount;
// 	}
// 
// 	public static class GenreComparator implements Comparator<Genre> {
// 		@Override
// 		public int compare(Genre genre1, Genre genre2) {
// 			String genre1Name = genre1.getName() != null ? genre1.getName() : "";
// 			String genre2Name = genre2.getName() != null ? genre2.getName() : "";
// 
// 			return genre1Name.compareToIgnoreCase(genre2Name);
// 		}
// 
// 		public static List<Genre> sort(List<Genre> genres) {
// 			Collections.sort(genres, new GenreComparator());
// 			return genres;
// 		}
// 
// 	}
// }


// Path: app/src/main/java/github/daneren2005/dsub/service/parser/GenreParser.java
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.text.Html;
import android.util.Log;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.Genre;
import github.daneren2005.dsub.util.ProgressListener;
import org.xmlpull.v1.XmlPullParser;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;

/*
 This file is part of Subsonic.

 Subsonic is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 Subsonic is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with Subsonic.  If not, see <http://www.gnu.org/licenses/>.

 Copyright 2010 (C) Sindre Mehus
 */
package github.daneren2005.dsub.service.parser;




/**
 * @author Joshua Bahnsen
 */
public class GenreParser extends AbstractParser {
	private static final String TAG = GenreParser.class.getSimpleName();
	
    public GenreParser(Context context, int instance) {
		super(context, instance);
	}

    public List<Genre> parse(Reader reader, ProgressListener progressListener) throws Exception {