// Path: app/src/main/java/com/hippo/nimingban/client/data/Forum.java
// public abstract class Forum {
// 
//     public abstract Site getNMBSite();
// 
//     public abstract String getNMBId();
// 
//     public abstract CharSequence getNMBDisplayname();
// 
//     public abstract String getNMBMsg();
// }


import com.hippo.nimingban.client.data.Forum;
import com.hippo.nimingban.dao.ACForumRaw;
import de.greenrobot.dao.query.LazyList;
        boolean pinned = isPinned(freq);
        int result = pinned ? setUnpinned(freq) : freq;

        if (result + 1 < FREQUENCY_UPPER_BOUND) { // make sure freq be in bound
            result++;
        }

        if (pinned) {
            result = setPinned(result);
        }
        return result;
    }

    private static Integer decrementFrequency(Integer freq) {
        if (freq == null) {
            return 0;
        }
        boolean pinned = isPinned(freq);
        int result = pinned ? setUnpinned(freq) : freq;

        if (result > 1) { // bypass freq == 1 so that visited forums are always before unvisited ones.
            result /= 2;
        }

        if (pinned) {
            result = setPinned(result);
        }
        return result;
    }

// Path: app/src/main/java/com/hippo/nimingban/client/data/Forum.java
// public abstract class Forum {
// 
//     public abstract Site getNMBSite();
// 
//     public abstract String getNMBId();
// 
//     public abstract CharSequence getNMBDisplayname();
// 
//     public abstract String getNMBMsg();
// }


// Path: app/src/main/java/com/hippo/nimingban/util/ForumAutoSortingUtils.java
import com.hippo.nimingban.client.data.Forum;
import com.hippo.nimingban.dao.ACForumRaw;
import de.greenrobot.dao.query.LazyList;

        boolean pinned = isPinned(freq);
        int result = pinned ? setUnpinned(freq) : freq;

        if (result + 1 < FREQUENCY_UPPER_BOUND) { // make sure freq be in bound
            result++;
        }

        if (pinned) {
            result = setPinned(result);
        }
        return result;
    }

    private static Integer decrementFrequency(Integer freq) {
        if (freq == null) {
            return 0;
        }
        boolean pinned = isPinned(freq);
        int result = pinned ? setUnpinned(freq) : freq;

        if (result > 1) { // bypass freq == 1 so that visited forums are always before unvisited ones.
            result /= 2;
        }

        if (pinned) {
            result = setPinned(result);
        }
        return result;
    }

    public static void addACForumFrequency(Forum forum) {