QuasiListModification.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:ReactFX 作者:
static <E, F extends E> QuasiListModification<E> fromCurrentStateOf(
        Change<F> ch) {
    List<F> list = ch.getList();
    int from = ch.getFrom();
    int addedSize = ch.getTo() - from; // use (to - from), because
                                       // ch.getAddedSize() is 0 on permutation

    List<F> removed;
    if(ch.wasPermutated()) {
        removed = new ArrayList<>(addedSize);
        for(int i = 0; i < addedSize; ++i) {
            int pi = ch.getPermutation(from + i);
            removed.add(list.get(pi));
        }
    } else {
        removed = ch.getRemoved();
    }
    return new QuasiListModificationImpl<>(from, removed, addedSize);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号