package honk.tools.anidb;

import java.io.Serializable;

/**
 * Information about an anime.
 * @author honk
 */
public class AnimeInfo implements Serializable {
    private static final long serialVersionUID = -8377626410363149941L;
    
    
    private int animeID;
    private int episodes;
    private int normalEpisodes;
    private int specialEpisodes;
    private int rating;
    private int voteCount;
    private int tempRating;
    private int tempVoteCount;
    private String picName;
    private String year;
    private String type;
    private String preferedName;    //for episodes
    private String romajiName;
    private String kanjiName;
    private String englishName;
    private String[] shortNameList;
    private String[] categoryList;
    private String description;
    private String relations;
    
    static final String SEPERATOR_CATEGORY = ",";
    static final String SEPERATOR_SHORTNAME = "'";

  
    /**
     * @param animeID
     * @param episodes
     * @param normalEpisodes
     * @param specialEpisodes
     * @param rating
     * @param voteCount
     * @param tempRating
     * @param tempVoteCount
     * @param picName
     * @param year
     * @param type
     * @param preferedName
     * @param romajiName
     * @param kanjiName
     * @param englishName
     * @param shortNameList
     * @param categoryList
     */
    public AnimeInfo(int animeID, int episodes, int normalEpisodes, int specialEpisodes, int rating, int voteCount, int tempRating, int tempVoteCount, String picName, String year, String type, String preferedName, String romajiName, String kanjiName, String englishName, String[] shortNameList, String[] categoryList, String description, String relations) {
        this.animeID = animeID;
        this.episodes = episodes;
        this.normalEpisodes = normalEpisodes;
        this.specialEpisodes = specialEpisodes;
        this.rating = rating;
        this.voteCount = voteCount;
        this.tempRating = tempRating;
        this.tempVoteCount = tempVoteCount;
        this.picName = picName;
        this.year = year;
        this.type = type;
        this.preferedName = preferedName;
        this.romajiName = romajiName;
        this.kanjiName = kanjiName;
        this.englishName = englishName;
        this.shortNameList = shortNameList;
        this.categoryList = categoryList;
        this.description = description;
        this.relations = relations;
    }

    /**
     * @return the animeID
     */
    public int getAnimeID() {
        return animeID;
    }

    /**
     * @return the categoryList
     */
    public String[] getCategoryList() {
        return categoryList;
    }

    /**
     * @return the englishName
     */
    public String getEnglishName() {
        return englishName;
    }

    /**
     * @return the episodes
     */
    public int getEpisodes() {
        return episodes;
    }

    /**
     * @return the kanjiName
     */
    public String getKanjiName() {
        return kanjiName;
    }

    /**
     * @return the normalEpisodes
     */
    public int getNormalEpisodes() {
        return normalEpisodes;
    }

    /**
     * @return the picName
     */
    public String getPicName() {
        return picName;
    }

    /**
     * @return the preferedName
     */
    public String getPreferedName() {
        return preferedName;
    }

    /**
     * @return the rating
     */
    public int getRating() {
        return rating;
    }

    /**
     * @return the romajiName
     */
    public String getRomajiName() {
        return romajiName;
    }

    /**
     * @return the shortNameList
     */
    public String[] getShortNameList() {
        return shortNameList;
    }

    /**
     * @return the specialEpisodes
     */
    public int getSpecialEpisodes() {
        return specialEpisodes;
    }

    /**
     * @return the tempRating
     */
    public int getTempRating() {
        return tempRating;
    }

    /**
     * @return the tempVoteCount
     */
    public int getTempVoteCount() {
        return tempVoteCount;
    }

    /**
     * @return the type
     */
    public String getType() {
        return type;
    }

    /**
     * @return the voteCount
     */
    public int getVoteCount() {
        return voteCount;
    }

    /**
     * @return the year
     */
    public String getYear() {
        return year;
    }
    
    
    public static String[] stringToArray(String string, String seperator) {
        if (string.length() == 0) {
            return new String[0];
        } else {
            return string.split(seperator);
        }
    }
    
    
    
    
    public static String arrayToString(String[] array, String seperator) {
        if (array.length == 0) {
            return "";
        }
        String out = array[0];
        for (int i=1;i<array.length;i++) {
            out += seperator+array[i];
        }
        return out;
    }

    /**
     * @return the sEPERATOR_CATEGORY
     */
    public static String getSEPERATOR_CATEGORY() {
        return SEPERATOR_CATEGORY;
    }

    /**
     * @return the sEPERATOR_SHORTNAME
     */
    public static String getSEPERATOR_SHORTNAME() {
        return SEPERATOR_SHORTNAME;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the serialVersionUID
     */
    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    /**
     * @return the usefulInfo
     */
    public String getRelations() {
        return relations;
    }
}
