<commit_before>package com.charlesmadere.hummingbird.adapters;

import android.content.Context;
import android.text.TextUtils;

import com.charlesmadere.hummingbird.R;
import com.charlesmadere.hummingbird.models.AnimeDigest;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.TreeMap;

public class AnimeCastingsAdapter extends BaseMultiAdapter implements Comparator<String> {

    public AnimeCastingsAdapter(final Context context) {
        super(context);
    }

    @Override
    public int compare(final String lhs, final String rhs) {
        if (TextUtils.isEmpty(lhs) && TextUtils.isEmpty(rhs)) {
            return 0;
        } else if (TextUtils.isEmpty(lhs)) {
            return Integer.MAX_VALUE;
        } else if (TextUtils.isEmpty(rhs)) {
            return Integer.MIN_VALUE;
        } else {
            return lhs.compareToIgnoreCase(rhs);
        }
    }

    @Override
    protected HashMap<Class, Integer> getItemViewKeyMap() {
        final HashMap<Class, Integer> map = new HashMap<>(2);
        map.put(AnimeDigest.Casting.class, R.layout.item_anime_casting);
        map.put(CharSequence.class, R.layout.item_charsequence_header);
        return map;
    }

    public void set(final ArrayList<AnimeDigest.Casting> castings) {
        final TreeMap<String, ArrayList<AnimeDigest.Casting>> map = new TreeMap<>(this);

        for (final AnimeDigest.Casting casting : castings) {
            final String language = casting.getLanguage();<commit_msg>fixed type exception<commit_after>package com.charlesmadere.hummingbird.adapters;

import android.content.Context;
import android.text.TextUtils;

import com.charlesmadere.hummingbird.R;
import com.charlesmadere.hummingbird.models.AnimeDigest;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.TreeMap;

public class AnimeCastingsAdapter extends BaseMultiAdapter implements Comparator<String> {

    public AnimeCastingsAdapter(final Context context) {
        super(context);
    }

    @Override
    public int compare(final String lhs, final String rhs) {
        if (TextUtils.isEmpty(lhs) && TextUtils.isEmpty(rhs)) {
            return 0;
        } else if (TextUtils.isEmpty(lhs)) {
            return Integer.MAX_VALUE;
        } else if (TextUtils.isEmpty(rhs)) {
            return Integer.MIN_VALUE;
        } else {
            return lhs.compareToIgnoreCase(rhs);
        }
    }

    @Override
    protected HashMap<Class, Integer> getItemViewKeyMap() {
        final HashMap<Class, Integer> map = new HashMap<>(2);
        map.put(AnimeDigest.Casting.class, R.layout.item_anime_casting);
        map.put(String.class, R.layout.item_charsequence_header);
        return map;
    }

    public void set(final ArrayList<AnimeDigest.Casting> castings) {
        final TreeMap<String, ArrayList<AnimeDigest.Casting>> map = new TreeMap<>(this);

        for (final AnimeDigest.Casting casting : castings) {
            final String language = casting.getLanguage();
{'fraction_non_alphanumeric': 0.09839291571006888, 'fraction_numerical': 0.0013119055428009183, 'mean_word_length': 3.2420027816411685, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1570513', 'n_tokens_mistral': 898, 'n_tokens_neox': 895, 'n_words': 189}