<commit_before>package com.knowledgex.domain;

import java.util.*;

import org.joda.time.DateTimeComparator;

public enum FragmentOrder {
    UPDATE_DATETIME
  , CREATION_DATETIME
  , TITLE
  , ID
  , COUNT
  ;    

    private static abstract class TransientComparator implements Comparator<Fragment> {}

    private static class TransientReverseComparator extends TransientComparator {
        final TransientComparator src;
        
        TransientReverseComparator(TransientComparator src) {
            this.src = src;
        }
        
        @Override
        public int compare(Fragment arg0, Fragment arg1) {
            return -src.compare(arg0, arg1);
        }
    }

    private static final class ComparatorForUpdateDatetime extends TransientComparator {
        @Override
        public int compare(Fragment arg0, Fragment arg1) {
            DateTimeComparator comparator = DateTimeComparator.getInstance();
            return comparator.compare(arg0.getUpdateDatetime(), arg1.getUpdateDatetime());
        }
    }
    
    private static final class ComparatorForCreationDatetime extends TransientComparator {
        @Override
        public int compare(Fragment arg0, Fragment arg1) {
            DateTimeComparator comparator = DateTimeComparator.getInstance();
            return comparator.compare(arg0.getCreationDatetime(), arg1.getCreationDatetime());
        }
    }

    private static final class ComparatorForTitle extends TransientComparator {
        @Override
        public int compare(Fragment arg0, Fragment arg1) {
            String s0 = arg0.getTitle();
            String s1 = arg1.getTitle();
            return s0.compareToIgnoreCase(s1);<commit_msg>[update] changed how to compare fragment titles; now it does not ignore case<commit_after>package com.knowledgex.domain;

import java.util.*;

import org.joda.time.DateTimeComparator;

public enum FragmentOrder {
    UPDATE_DATETIME
  , CREATION_DATETIME
  , TITLE
  , ID
  , COUNT
  ;    

    private static abstract class TransientComparator implements Comparator<Fragment> {}

    private static class TransientReverseComparator extends TransientComparator {
        final TransientComparator src;
        
        TransientReverseComparator(TransientComparator src) {
            this.src = src;
        }
        
        @Override
        public int compare(Fragment arg0, Fragment arg1) {
            return -src.compare(arg0, arg1);
        }
    }

    private static final class ComparatorForUpdateDatetime extends TransientComparator {
        @Override
        public int compare(Fragment arg0, Fragment arg1) {
            DateTimeComparator comparator = DateTimeComparator.getInstance();
            return comparator.compare(arg0.getUpdateDatetime(), arg1.getUpdateDatetime());
        }
    }
    
    private static final class ComparatorForCreationDatetime extends TransientComparator {
        @Override
        public int compare(Fragment arg0, Fragment arg1) {
            DateTimeComparator comparator = DateTimeComparator.getInstance();
            return comparator.compare(arg0.getCreationDatetime(), arg1.getCreationDatetime());
        }
    }

    private static final class ComparatorForTitle extends TransientComparator {
        @Override
        public int compare(Fragment arg0, Fragment arg1) {
            String s0 = arg0.getTitle();
            String s1 = arg1.getTitle();
//            return s0.compareToIgnoreCase(s1);
            return s0.compareTo(s1);
{'fraction_non_alphanumeric': 0.06786941580756013, 'fraction_numerical': 0.012027491408934709, 'mean_word_length': 2.7238805970149254, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3223013', 'n_tokens_mistral': 889, 'n_tokens_neox': 873, 'n_words': 225}