Class Inventory<T extends RfidTag>

    • Constructor Summary

      Constructors 
      Constructor Description
      Inventory​(java.lang.String identifier)
      Create a new inventory
      Inventory​(java.lang.String identifier, InventoryListener<T> listener)
      Create a new inventory
      Inventory​(java.lang.String identifier, InventoryListener<T> listener, long tagKeepTime)
      Create a new inventory
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addTag​(T tag)  
      void clear()
      Remove all tags from the inventory
      java.util.List<T> getInventory()
      Return a List with the current inventory
      long getKeepTime()  
      void initInventory​(java.util.List<T> inventory)
      initialise the inventory
      boolean isAlive()  
      boolean isSticky()  
      void removeTag​(java.lang.String tagEid)
      Remove a tag from this list
      void removeTag​(T tag)  
      void setKeepTime​(long keepTime)  
      void start()
      start automatically checking the inventory for lost tags
      void stop()
      stop automatically checking tags
      void updateInventory​(java.util.Collection<T> inventory)
      update the current inventory
      • Methods inherited from class java.lang.Object

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

      • Inventory

        public Inventory​(java.lang.String identifier)
        Create a new inventory
        Parameters:
        identifier - inventory identifier
      • Inventory

        public Inventory​(java.lang.String identifier,
                         InventoryListener<T> listener)
        Create a new inventory
        Parameters:
        identifier - inventory identifier
        listener - the listener
      • Inventory

        public Inventory​(java.lang.String identifier,
                         InventoryListener<T> listener,
                         long tagKeepTime)
        Create a new inventory
        Parameters:
        identifier - inventory identifier
        listener - the listener
        tagKeepTime - the tag keep time (to disable automatic removing tags, set keep time to 0)
    • Method Detail

      • initInventory

        public void initInventory​(java.util.List<T> inventory)
        initialise the inventory
        Parameters:
        inventory - tags
      • updateInventory

        public void updateInventory​(java.util.Collection<T> inventory)
        update the current inventory
        Parameters:
        inventory - Collection with the tag ids
      • addTag

        public void addTag​(T tag)
      • removeTag

        public void removeTag​(T tag)
      • getInventory

        public java.util.List<T> getInventory()
        Return a List with the current inventory
        Returns:
        a List with the current inventory
      • getKeepTime

        public long getKeepTime()
        Returns:
        the current tag keep time
      • setKeepTime

        public void setKeepTime​(long keepTime)
        Parameters:
        keepTime - the tag keep time to set
      • start

        public void start()
        start automatically checking the inventory for lost tags
      • stop

        public void stop()
        stop automatically checking tags
      • isSticky

        public boolean isSticky()
        Returns:
        the isSticky
      • removeTag

        public void removeTag​(java.lang.String tagEid)
        Remove a tag from this list
        Parameters:
        tagEid - tag eid to remove
      • clear

        public void clear()
        Remove all tags from the inventory
      • isAlive

        public boolean isAlive()
        Returns:
        true if the inventory checking thread is alive