// Path: lib-core/src/main/java/com/nhaarman/listviewanimations/util/Insertable.java
// public interface Insertable<T> {
// 
//     /**
//      * Will be called to insert given {@code item} at given {@code index} in the list.
//      *
//      * @param index the index the new item should be inserted at
//      * @param item  the item to insert
//      */
//     void add(int index, @NonNull T item);
// }


import android.support.annotation.NonNull;
import android.util.Pair;
import com.nhaarman.listviewanimations.util.Insertable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/*
 * Copyright 2014 Niek Haarman
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.nhaarman.listviewanimations.itemmanipulation.animateaddition;




/**
 * A class to insert items only when there are no active items.
 * A pending index-item pair can have two states: active and pending. When inserting new items, the {@link com.nhaarman.listviewanimations.itemmanipulation
 * .AnimateAdditionAdapter.Insertable#add
 * (int, Object)} method will be called directly if there are no active index-item pairs.
 * Otherwise, pairs will be queued until the active list is empty.
 */
public class InsertQueue<T> {

    @NonNull
// Path: lib-core/src/main/java/com/nhaarman/listviewanimations/util/Insertable.java
// public interface Insertable<T> {
// 
//     /**
//      * Will be called to insert given {@code item} at given {@code index} in the list.
//      *
//      * @param index the index the new item should be inserted at
//      * @param item  the item to insert
//      */
//     void add(int index, @NonNull T item);
// }


// Path: lib-manipulation/src/main/java/com/nhaarman/listviewanimations/itemmanipulation/animateaddition/InsertQueue.java
import android.support.annotation.NonNull;
import android.util.Pair;
import com.nhaarman.listviewanimations.util.Insertable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

/*
 * Copyright 2014 Niek Haarman
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.nhaarman.listviewanimations.itemmanipulation.animateaddition;




/**
 * A class to insert items only when there are no active items.
 * A pending index-item pair can have two states: active and pending. When inserting new items, the {@link com.nhaarman.listviewanimations.itemmanipulation
 * .AnimateAdditionAdapter.Insertable#add
 * (int, Object)} method will be called directly if there are no active index-item pairs.
 * Otherwise, pairs will be queued until the active list is empty.
 */
public class InsertQueue<T> {

    @NonNull
    private final Insertable<T> mInsertable;