package refinedstorage.api.util;

import net.minecraft.item.ItemStack;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection;

public interface IItemStackList {
    void add(ItemStack stack);

    boolean remove(@Nonnull ItemStack stack, boolean removeIfReachedZero);

    @Nullable
    ItemStack get(@Nonnull ItemStack stack, int flags);

    @Nullable
    ItemStack get(int hash);

    void clear();

    boolean isEmpty();

    @Nonnull
    Collection<ItemStack> getStacks();

    @Nonnull
    IItemStackList copy();
}

@@ -162,16 +162,47 @@
 ction;%0A%0A
+/**%0A * An item stack list.%0A */%0A
 public i
@@ -235,322 +235,1506 @@
     
-void add(ItemStack stack);%0A%0A    boolean remove(@Nonnull ItemStack stack, boolean removeIfReachedZero);%0A%0A    @Nullable%0A    ItemStack get(@Nonnull ItemStack stack, int flags);%0A%0A    @Nullable%0A    ItemStack get(int hash);%0A%0A    void clear();%0A%0A    boolean isEmpty();%0A%0A    @Nonnull%0A    Collection%3CItemStack%3E getStacks();%0A
+/**%0A     * Adds a stack to the list, will merge it with another stack if it already exists in the list.%0A     *%0A     * @param stack the stack%0A     */%0A    void add(ItemStack stack);%0A%0A    /**%0A     * Decrements the count of that stack in the list.%0A     *%0A     * @param stack               the stack%0A     * @param removeIfReachedZero true to remove the stack if the count reaches 0, false otherwise%0A     * @return whether the remove was successful%0A     */%0A    boolean remove(@Nonnull ItemStack stack, boolean removeIfReachedZero);%0A%0A    /**%0A     * Returns a stack.%0A     *%0A     * @param stack the stack to search for%0A     * @param flags the flags to compare on, see %7B@link refinedstorage.api.storage.CompareUtils%7D%0A     * @return the stack, or null if no stack was found%0A     */%0A    @Nullable%0A    ItemStack get(@Nonnull ItemStack stack, int flags);%0A%0A    /**%0A     * Returns a stack.%0A     *%0A     * @param hash the hash of the stack to search for, see %7B@link refinedstorage.api.network.NetworkUtils#getItemStackHashCode(ItemStack)%7D%0A     * @return the stack, or null if no stack was found%0A     */%0A    @Nullable%0A    ItemStack get(int hash);%0A%0A    /**%0A     * Clears the list.%0A     */%0A    void clear();%0A%0A    /**%0A     * @return true if the list is empty, false otherwise%0A     */%0A    boolean isEmpty();%0A%0A    /**%0A     * @return a collection of stacks in this list%0A     */%0A    @Nonnull%0A    Collection%3CItemStack%3E getStacks();%0A%0A    /**%0A     * @return a new copy of this list, with the stacks in it copied as well%0A     */
 %0A   

Add docs