@@ -0,0 +1,2637 @@
+/*%0A * This file is part of GenericsLib for Bukkit, licensed under the MIT License (MIT).%0A *%0A * Copyright (c) JCThePants (www.jcwhatever.com)%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0A * of this software and associated documentation files (the %22Software%22), to deal%0A * in the Software without restriction, including without limitation the rights%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A * copies of the Software, and to permit persons to whom the Software is%0A * furnished to do so, subject to the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in%0A * all copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN%0A * THE SOFTWARE.%0A */%0A%0Apackage com.jcwhatever.bukkit.generic.collections;%0A%0Aimport java.util.HashSet;%0Aimport java.util.Map;%0Aimport java.util.Set;%0Aimport java.util.WeakHashMap;%0A%0A/**%0A * A %7B@code WeakHashMap%7D that uses hash sets to store values.%0A *%0A * @param %3CK%3E  Key type%0A * @param %3CV%3E  Value type%0A */%0Apublic class WeakHashSetMap%3CK, V%3E extends AbstractSetMap%3CK, V%3E %7B%0A%0A    protected final Map%3CK, Set%3CV%3E%3E _map;%0A    protected final int _setSize;%0A%0A    /**%0A     * Constructor.%0A     *%0A     * %3Cp%3EMap capacity starts at 10 elements%3C/p%3E%0A     *%0A     * %3Cp%3ESet capacity starts at 10 elements.%3C/p%3E%0A     */%0A    public WeakHashSetMap()%7B%0A        this(10, 10);%0A    %7D%0A%0A    /**%0A     * Constructor.%0A     *%0A     * %3Cp%3ESet capacity starts at 10 elements.%3C/p%3E%0A     *%0A     * @param mapSize  The initial capacity of the map.%0A     */%0A    public WeakHashSetMap(int mapSize) %7B%0A        this(mapSize, 10);%0A    %7D%0A%0A    /**%0A     * Constructor.%0A     *%0A     * @param mapSize  The initial capacity of the map.%0A     * @param setSize  The initial capacity of sets.%0A     */%0A    public WeakHashSetMap(int mapSize, int setSize) %7B%0A        _map = new WeakHashMap%3C%3E(mapSize);%0A%0A        _setSize = setSize;%0A    %7D%0A%0A    @Override%0A    protected Map%3CK, Set%3CV%3E%3E getMap() %7B%0A        return _map;%0A    %7D%0A%0A    @Override%0A    protected Set%3CV%3E createSet() %7B%0A        return createSet(_setSize);%0A    %7D%0A%0A    @Override%0A    protected Set%3CV%3E createSet(int size) %7B%0A        return new HashSet%3C%3E(size);%0A    %7D%0A%7D%0A

add WeakHashSetMap