<commit_before>package net.somethingdreadful.MAL.api.response;

import android.database.Cursor;

import net.somethingdreadful.MAL.sql.MALSqlHelper;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

public class Anime extends GenericRecord implements Serializable {

    public static final String STATUS_WATCHING = "watching";
    public static final String STATUS_PLANTOWATCH = "plan to watch";

    private int episodes;
    private String watched_status;
    private int watched_episodes;
    private String classification;
    private int listed_anime_id;
    /*private Date start_date;
    private Date end_date;*/
    private ArrayList<RecordStub> alternative_versions;
    private ArrayList<RecordStub> character_anime;
    private ArrayList<RecordStub> prequels;
    private ArrayList<RecordStub> sequels;
    private ArrayList<RecordStub> side_stories;
    private ArrayList<RecordStub> summaries;
    private ArrayList<RecordStub> spin_offs;
    private ArrayList<RecordStub> manga_adaptations;
    private RecordStub parent_story;

    public static Anime fromCursor(Cursor c) {
        Anime result = new Anime();
        result.setCreatedFromCursor(true);
        List<String> columnNames = Arrays.asList(c.getColumnNames());
        result.setId(c.getInt(columnNames.indexOf(MALSqlHelper.COLUMN_ID)));
        result.setTitle(c.getString(columnNames.indexOf("recordName")));
        result.setType(c.getString(columnNames.indexOf("recordType")));
        result.setStatus(c.getString(columnNames.indexOf("recordStatus")));
        result.setWatchedStatus(c.getString(columnNames.indexOf("myStatus")));
        result.setWatchedEpisodes(c.getInt(columnNames.indexOf("episodesWatched")));
        result.setEpisodes(c.getInt(columnNames.indexOf("episodesTotal")));
        result.setMembersScore(c.getFloat(columnNames.indexOf("memberScore")));
        result.setScore(c.getInt(columnNames.indexOf("myScore")));
        result.setSynopsis(c.getString(columnNames.indexOf("synopsis")));
        result.setImageUrl(c.getString(columnNames.indexOf("imageUrl")));
        result.setDirty(c.getInt(columnNames.indexOf("dirty")) > 0);
        result.setClassification(c.getString(columnNames.indexOf("classification")));
        result.setMembersCount(c.getInt(columnNames.indexOf("membersCount")));
        result.setFavoritedCount(c.getInt(columnNames.indexOf("favoritedCount")));
        result.setPopularityRank(c.getInt(columnNames.indexOf("popularityRank")));
        result.setRank(c.getInt(columnNames.indexOf("rank")));
        result.setListedId(c.getInt(columnNames.indexOf("listedId")));
        Date lastUpdateDate;
        try {
            long lastUpdate = c.getLong(columnNames.indexOf("lastUpdate"));
            lastUpdateDate = new Date(lastUpdate);
        } catch (Exception e) { // database entry was null
            lastUpdateDate = null;
        }
        result.setLastUpdate(lastUpdateDate);
        return result;
    }

    public int getEpisodes() {
        return episodes;
    }

    public void setEpisodes(int episodes) {
        this.episodes = episodes;
    }

    public String getWatchedStatus() {
        return watched_status;
    }

    public void setWatchedStatus(String watched_status) {
        this.watched_status = watched_status;
    }

    public int getWatchedEpisodes() {
        return watched_episodes;
    }

    public void setWatchedEpisodes(int watched_episodes) {
        this.watched_episodes = watched_episodes;
    }

    public String getClassification() {
        return classification;
    }

    public void setClassification(String classification) {<commit_msg>Add get/set method for start & end dates (Anime)<commit_after>package net.somethingdreadful.MAL.api.response;

import android.database.Cursor;

import net.somethingdreadful.MAL.sql.MALSqlHelper;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

public class Anime extends GenericRecord implements Serializable {

    public static final String STATUS_WATCHING = "watching";
    public static final String STATUS_PLANTOWATCH = "plan to watch";

    private int episodes;
    private String watched_status;
    private int watched_episodes;
    private String classification;
    private int listed_anime_id;
    /*private Date start_date;
    private Date end_date;*/
    private String watching_start;
    private String watching_end;
    private ArrayList<RecordStub> alternative_versions;
    private ArrayList<RecordStub> character_anime;
    private ArrayList<RecordStub> prequels;
    private ArrayList<RecordStub> sequels;
    private ArrayList<RecordStub> side_stories;
    private ArrayList<RecordStub> summaries;
    private ArrayList<RecordStub> spin_offs;
    private ArrayList<RecordStub> manga_adaptations;
    private RecordStub parent_story;

    public static Anime fromCursor(Cursor c) {
        Anime result = new Anime();
        result.setCreatedFromCursor(true);
        List<String> columnNames = Arrays.asList(c.getColumnNames());
        result.setId(c.getInt(columnNames.indexOf(MALSqlHelper.COLUMN_ID)));
        result.setTitle(c.getString(columnNames.indexOf("recordName")));
        result.setType(c.getString(columnNames.indexOf("recordType")));
        result.setStatus(c.getString(columnNames.indexOf("recordStatus")));
        result.setWatchedStatus(c.getString(columnNames.indexOf("myStatus")));
        result.setWatchedEpisodes(c.getInt(columnNames.indexOf("episodesWatched")));
        result.setEpisodes(c.getInt(columnNames.indexOf("episodesTotal")));
        result.setWatchingStart(c.getString(columnNames.indexOf("watchingStart")));
        result.setWatchingEnd(c.getString(columnNames.indexOf("watchingEnd")));
        result.setMembersScore(c.getFloat(columnNames.indexOf("memberScore")));
        result.setScore(c.getInt(columnNames.indexOf("myScore")));
        result.setSynopsis(c.getString(columnNames.indexOf("synopsis")));
        result.setImageUrl(c.getString(columnNames.indexOf("imageUrl")));
        result.setDirty(c.getInt(columnNames.indexOf("dirty")) > 0);
        result.setClassification(c.getString(columnNames.indexOf("classification")));
        result.setMembersCount(c.getInt(columnNames.indexOf("membersCount")));
        result.setFavoritedCount(c.getInt(columnNames.indexOf("favoritedCount")));
        result.setPopularityRank(c.getInt(columnNames.indexOf("popularityRank")));
        result.setRank(c.getInt(columnNames.indexOf("rank")));
        result.setListedId(c.getInt(columnNames.indexOf("listedId")));
        Date lastUpdateDate;
        try {
            long lastUpdate = c.getLong(columnNames.indexOf("lastUpdate"));
            lastUpdateDate = new Date(lastUpdate);
        } catch (Exception e) { // database entry was null
            lastUpdateDate = null;
        }
        result.setLastUpdate(lastUpdateDate);
        return result;
    }

    public int getEpisodes() {
        return episodes;
    }

    public void setEpisodes(int episodes) {
        this.episodes = episodes;
    }

    public String getWatchedStatus() {
        return watched_status;
    }

    public void setWatchedStatus(String watched_status) {
        this.watched_status = watched_status;
    }

    public int getWatchedEpisodes() {
        return watched_episodes;
    }

    public void setWatchedEpisodes(int watched_episodes) {
        this.watched_episodes = watched_episodes;
    }

    public String getWatchingStart() {
        return watching_start;
    }

    public void setWatchingStart(String watching_start) {
        this.watching_start = watching_start;
    }

    public String getWatchingEnd() {
        return watching_end;
    }

    public void setWatchingEnd(String watching_end) {
        this.watching_end = watching_end;
    }

    public String getClassification() {
        return classification;
    }

    public void setClassification(String classification) {
{'fraction_non_alphanumeric': 0.10299044546469785, 'fraction_numerical': 0.0002481697481077057, 'mean_word_length': 3.803337306317044, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3401615', 'n_tokens_mistral': 2250, 'n_tokens_neox': 2284, 'n_words': 397}