Class DepositBox


  • public class DepositBox
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static void add​(int index, Item t)  
      static boolean add​(Item t)  
      static java.util.List<Item> all()  
      static java.util.List<Item> all​(Filter<Item> filter)
      A list of all the filtered items.
      static int capacity()  
      static boolean close()
      Attempts to close an opened deposit box, if open
      static boolean contains​(int id)
      Checks if deposit box contains an Item with given ID
      static boolean contains​(java.lang.Integer... ids)
      Checks if your collection contains at least one item which meets any of the specified ids.
      static boolean contains​(java.lang.Object o)  
      static boolean contains​(java.lang.String string)
      Determines if deposit box contains item with specified name.
      static boolean contains​(java.lang.String... names)
      Checks if your collection contains at least one item which meets any of the specified names.
      static boolean contains​(Filter<Item> filter)
      Checks if your collection contains at least one item which meets the specified filter.
      static boolean containsAll​(int... ids)
      Checks if the deposit box contains all of the items with specified IDs
      static boolean containsAll​(java.lang.String... names)
      Checks if the deposit box contains all of the items with names specified
      static boolean containsAll​(java.util.Collection<?> collection)
      Checks if the deposit box contains all of the checks in the given Collection
      static int count​(int id)
      Count of all the items that match the search.
      static int count​(java.lang.String name)
      Count of all the items that match the search.
      static int count​(Filter<Item> filter)
      Count of all the items that match the search.
      static boolean deposit​(int id)  
      static boolean deposit​(int id, int amount)  
      static boolean deposit​(java.lang.String name)  
      static boolean deposit​(java.lang.String name, int amount)  
      static boolean deposit​(Filter<Item> filter)  
      static boolean deposit​(Filter<Item> filter, int amount)  
      static boolean deposit​(Item item)  
      static boolean deposit​(Item item, int amount)  
      static boolean depositAll​(int id)  
      static boolean depositAll​(java.lang.String name)  
      static boolean depositAll​(Filter<Item> filter)  
      static boolean depositAll​(Item item)  
      static boolean depositAllEquipment()  
      static boolean depositAllExcept​(java.lang.Integer... ids)  
      static boolean depositAllExcept​(java.lang.String... names)  
      static boolean depositAllExcept​(Filter<Item> filter)  
      static boolean depositAllItems()  
      static boolean depositAllLoot()  
      static int emptySlotCount()
      Empty slot count.
      static java.util.List<Item> except​(Filter<Item> filter)
      Get all items which do not fit the given criteria.
      static int fullSlotCount()
      Full slot count.
      static Item get​(int id)
      Gets the first item with the given ID
      static Item get​(int[] ids)
      static Item get​(java.lang.Integer... ids)
      Gets the first item with the given IDs
      static Item get​(java.lang.String name)
      Get item for specified name.
      static Item get​(java.lang.String... names)
      Gets the first item that matches one of the given names
      static Item get​(Filter<Item> filter)
      Gets the first item that matches the given filter
      static int getFirstEmptySlot()
      Gets the first empty slot in the deposit box.
      static int getFirstFullSlot()
      Gets the next full slot in the deposit box
      static int getIdForSlot​(int slot)
      Gets the Id of the Item in the slot.
      static Item getItemInSlot​(int slot)
      Gets item in specified slot.
      static java.lang.String getNameForSlot​(int slot)
      Gets the Name for the Item in the slot.
      static WidgetChild getSlotWidget​(int slot)  
      static boolean isEmpty()  
      static boolean isFull()
      Determines if container full.
      static boolean isOpen()
      Checks whether you have a deposit box open
      static boolean isSlotEmpty​(int slot)  
      static boolean isSlotFull​(int slot)
      Checks if the slot has an Item in it
      static boolean onlyContains​(java.lang.Integer... id)
      Checks if the deposit box only contains items with specified ID
      static boolean onlyContains​(java.lang.String... names)
      Checks if your Inventory only contains items with specified name
      static boolean onlyContains​(Filter<Item> f)
      Checks if the deposit box only contains items that match the Filter
      static boolean open()
      Attempts to open the nearest loaded Bank Deposit Box
      static boolean openClosest()
      see open()
      static Item set​(int index, Item element)  
      static int size()  
      static int slot​(int id)
      Gets the slot for the item with specified ID.
      static int slot​(java.lang.String name)
      Gets the slot for the item with specified name.
      static int slot​(Filter<Item> filter)
      Gets the slot for the item with specified filter.
      static java.awt.Rectangle slotBounds​(int slot)
      Gets the Rectangle of the slot
      static boolean slotContains​(int slot, int[] ids)
      static boolean slotContains​(int slot, java.lang.Integer... ids)
      Checks if the slot contains items that matches the given ids.
      static boolean slotContains​(int slot, java.lang.String name)
      Checks if the slot contains an item with the name containing the given name
      static boolean slotContains​(int slot, java.lang.String... names)
      Checks if the slot contains items that matches the given names.
      static boolean slotContains​(int slot, Filter<Item> filter)
      Checks if the slot contains an item that matches the filter.
      static boolean slotContains​(int slot, Item t)
      Checks if the slot contains the given Item
      static boolean slotNameContains​(int slot, java.lang.String sub)
      Deprecated.
      static java.lang.Object[] toArray()  
      static int widgetChildId()  
      static int widgetParentId()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • widgetParentId

        public static int widgetParentId()
      • widgetChildId

        public static int widgetChildId()
      • capacity

        public static int capacity()
      • all

        public static java.util.List<Item> all()
      • isOpen

        public static boolean isOpen()
        Checks whether you have a deposit box open
        Returns:
        true if open
      • open

        public static boolean open()
        Attempts to open the nearest loaded Bank Deposit Box
        Returns:
        true if successfully opened
      • openClosest

        public static boolean openClosest()
        see open()
      • close

        public static boolean close()
        Attempts to close an opened deposit box, if open
        Returns:
        true if successfully closed or not currently open
      • depositAllItems

        public static boolean depositAllItems()
      • depositAllEquipment

        public static boolean depositAllEquipment()
      • depositAllLoot

        public static boolean depositAllLoot()
      • depositAllExcept

        public static boolean depositAllExcept​(Filter<Item> filter)
      • deposit

        public static boolean deposit​(Filter<Item> filter,
                                      int amount)
      • slotBounds

        public static java.awt.Rectangle slotBounds​(int slot)
        Gets the Rectangle of the slot
        Parameters:
        slot - Integer value of the slot
        Returns:
        Rectangle of the slot
      • getSlotWidget

        public static WidgetChild getSlotWidget​(int slot)
      • depositAll

        public static boolean depositAll​(Filter<Item> filter)
      • deposit

        public static boolean deposit​(int id,
                                      int amount)
      • deposit

        public static boolean deposit​(java.lang.String name,
                                      int amount)
      • deposit

        public static boolean deposit​(Item item,
                                      int amount)
      • depositAllExcept

        public static boolean depositAllExcept​(java.lang.String... names)
      • depositAllExcept

        public static boolean depositAllExcept​(java.lang.Integer... ids)
      • deposit

        public static boolean deposit​(int id)
      • deposit

        public static boolean deposit​(java.lang.String name)
      • deposit

        public static boolean deposit​(Item item)
      • deposit

        public static boolean deposit​(Filter<Item> filter)
      • depositAll

        public static boolean depositAll​(int id)
      • depositAll

        public static boolean depositAll​(java.lang.String name)
      • depositAll

        public static boolean depositAll​(Item item)
      • fullSlotCount

        public static int fullSlotCount()
        Full slot count.
        Returns:
        the count of full slots as an int.
      • emptySlotCount

        public static int emptySlotCount()
        Empty slot count.
        Returns:
        the count of empty slots as an int.
      • isSlotEmpty

        public static boolean isSlotEmpty​(int slot)
      • isSlotFull

        public static boolean isSlotFull​(int slot)
        Checks if the slot has an Item in it
        Parameters:
        slot - slot to check
        Returns:
        True if there's an item there, else False
      • onlyContains

        public static boolean onlyContains​(java.lang.String... names)
        Checks if your Inventory only contains items with specified name
        Parameters:
        names - Names of items to look for
        Returns:
        True if only contains items with that name, else False
      • onlyContains

        public static boolean onlyContains​(java.lang.Integer... id)
        Checks if the deposit box only contains items with specified ID
        Parameters:
        id - IDs of items to check for
        Returns:
        True if only contains items with specified ID, else False
      • onlyContains

        public static boolean onlyContains​(Filter<Item> f)
        Checks if the deposit box only contains items that match the Filter
        Parameters:
        f - Filter to pass items through
        Returns:
        True if only contains items matching Filter, else False
      • slotContains

        public static boolean slotContains​(int slot,
                                           java.lang.String... names)
        Checks if the slot contains items that matches the given names.
        Parameters:
        names - names of the items to check
        Returns:
        true if slot contains item matching one of the names, else false
      • slotNameContains

        @Deprecated
        public static boolean slotNameContains​(int slot,
                                               java.lang.String sub)
        Deprecated.
      • slotContains

        public static boolean slotContains​(int slot,
                                           java.lang.String name)
        Checks if the slot contains an item with the name containing the given name
        Parameters:
        name - name of the item to check
        Returns:
        true if slot contains item with name containing given name, else false
      • slotContains

        public static boolean slotContains​(int slot,
                                           java.lang.Integer... ids)
        Checks if the slot contains items that matches the given ids.
        Parameters:
        ids - ids of the items to check.
        Returns:
        True if slot contains an item with one of the given ids, else false.
      • slotContains

        public static boolean slotContains​(int slot,
                                           Item t)
        Checks if the slot contains the given Item
        Parameters:
        slot - the slot to check
        t - The Item to check.
        Returns:
        True if slot contains given Item, else false.
      • slotContains

        public static boolean slotContains​(int slot,
                                           Filter<Item> filter)
        Checks if the slot contains an item that matches the filter.
        Parameters:
        slot - slot to check
        filter - Filter to pass items through.
        Returns:
        True if slot contains an Item that matches the given filter, else false.
      • getFirstEmptySlot

        public static int getFirstEmptySlot()
        Gets the first empty slot in the deposit box.
        Returns:
        slot number, if deposit box is full -1.
      • getFirstFullSlot

        public static int getFirstFullSlot()
        Gets the next full slot in the deposit box
        Returns:
        slot number, if deposit box is empty -1
      • getIdForSlot

        public static int getIdForSlot​(int slot)
        Gets the Id of the Item in the slot.
        Parameters:
        slot - Slot to get item id of.
        Returns:
        Item ID or -1 if no item.
      • getNameForSlot

        public static java.lang.String getNameForSlot​(int slot)
        Gets the Name for the Item in the slot. NOTE: Does not return null if slot is empty
        Parameters:
        slot - Slot to get item name of.
        Returns:
        Item name or "" if item is null.
      • slot

        public static int slot​(int id)
        Gets the slot for the item with specified ID.
        Parameters:
        id - ID of item to get slot of.
        Returns:
        Item slot or -1 if Item is null.
      • slot

        public static int slot​(java.lang.String name)
        Gets the slot for the item with specified name.
        Parameters:
        name - Name of item to get slot of.
        Returns:
        Item slot or -1 if Item is null.
      • slot

        public static int slot​(Filter<Item> filter)
        Gets the slot for the item with specified filter.
        Parameters:
        filter - filter of the item to get slot of.
        Returns:
        Item slot or -1 if Item is null.
      • add

        public static boolean add​(Item t)
      • toArray

        public static java.lang.Object[] toArray()
      • add

        public static void add​(int index,
                               Item t)
      • all

        public static java.util.List<Item> all​(Filter<Item> filter)
        A list of all the filtered items.
        Parameters:
        filter - the filter to search with.
        Returns:
        the list of all filtered items.
      • getItemInSlot

        public static Item getItemInSlot​(int slot)
        Gets item in specified slot.
        Parameters:
        slot - the slot.
        Returns:
        the item in slot.
      • get

        public static Item get​(int id)
        Gets the first item with the given ID
        Parameters:
        id - ID of item to search for
        Returns:
        First Item that matches given ID, null if none found
      • get

        public static Item get​(java.lang.Integer... ids)
        Gets the first item with the given IDs
        Parameters:
        ids - IDs of item to search for
        Returns:
        First Item that matches one of the given IDs, null if none found
      • get

        public static Item get​(java.lang.String name)
        Get item for specified name.
        Parameters:
        name - the name of the item.
        Returns:
        the item with given name, otherwise null.
      • get

        public static Item get​(java.lang.String... names)
        Gets the first item that matches one of the given names
        Parameters:
        names - names to check for
        Returns:
        first item that matches one of the given names, else null if none found
      • get

        public static Item get​(Filter<Item> filter)
        Gets the first item that matches the given filter
        Parameters:
        filter - filter to check for
        Returns:
        first item that matches the given filter, else null if none found
      • except

        public static java.util.List<Item> except​(Filter<Item> filter)
        Get all items which do not fit the given criteria.
        Parameters:
        filter - The filter of the items to ignore.
        Returns:
        The list of items found which do not match the given criteria.
      • size

        public static int size()
      • isEmpty

        public static boolean isEmpty()
      • contains

        public static boolean contains​(int id)
        Checks if deposit box contains an Item with given ID
        Parameters:
        id - the id
        Returns:
        true if contains, else false
      • contains

        public static boolean contains​(java.lang.String string)
        Determines if deposit box contains item with specified name.
        Parameters:
        string - the name of the item.
        Returns:
        true if deposit box contains item, otherwise false.
      • containsAll

        public static boolean containsAll​(java.lang.String... names)
        Checks if the deposit box contains all of the items with names specified
        Parameters:
        names - Names of items to check for
        Returns:
        True if deposit box contains all names, else False
      • containsAll

        public static boolean containsAll​(int... ids)
        Checks if the deposit box contains all of the items with specified IDs
        Parameters:
        ids - IDs of items to check for
        Returns:
        True if deposit box contains all IDs, else false.
      • containsAll

        public static boolean containsAll​(java.util.Collection<?> collection)
        Checks if the deposit box contains all of the checks in the given Collection
        Parameters:
        collection - The collection of checks to look for
        Returns:
        True if deposit box contains all of the items, else false.
      • contains

        public static boolean contains​(java.lang.Integer... ids)
        Checks if your collection contains at least one item which meets any of the specified ids.
        Parameters:
        ids - Item IDs to check for
        Returns:
        True if contains at least one of, else false
      • contains

        public static boolean contains​(java.lang.String... names)
        Checks if your collection contains at least one item which meets any of the specified names.
        Parameters:
        names - names to check for
        Returns:
        true if contains at least one of, else false.
      • contains

        public static boolean contains​(Filter<Item> filter)
        Checks if your collection contains at least one item which meets the specified filter.
        Parameters:
        filter - the filter to search with.
        Returns:
        true if contains at least one of, else false.
      • contains

        public static boolean contains​(java.lang.Object o)
      • isFull

        public static boolean isFull()
        Determines if container full.
        Returns:
        the boolean
      • count

        public static int count​(java.lang.String name)
        Count of all the items that match the search.
        Parameters:
        name - the name of the item.
        Returns:
        the total count of matching items.
      • count

        public static int count​(int id)
        Count of all the items that match the search.
        Parameters:
        id - the id of them item.
        Returns:
        the total count of matching items.
      • count

        public static int count​(Filter<Item> filter)
        Count of all the items that match the search.
        Parameters:
        filter - the filter to count with
        Returns:
        the total count of matching items.
      • set

        public static Item set​(int index,
                               Item element)