Class TemporaryList<T>

java.lang.Object
org.snmp4j.agent.util.TemporaryList<T>

public class TemporaryList<T> extends Object
The TemporaryList implements a list whose items are automatically removed after a predefined timeout. When an item is removed by timeout, listener can be called to handle the remove operation.
Author:
Frank Fock
  • Field Details

  • Constructor Details

    • TemporaryList

      public TemporaryList()
    • TemporaryList

      public TemporaryList(int timeout)
      Creates a temporary list with the given timeout in milliseconds.
      Parameters:
      timeout - the milliseconds to wait before an entry may get removed from this list.
  • Method Details

    • add

      public void add(T o)
    • contains

      public boolean contains(T o)
    • remove

      public boolean remove(T o)
    • setTimeout

      public void setTimeout(int timeout)
      Set the timeout for requests in this request list in milliseconds.
      Parameters:
      timeout - a timeout value in milliseconds greater than zero.
    • getTimeout

      public int getTimeout()
      Get the timeout for requests in this list in milliseconds.
      Returns:
      a timeout greater than zero in milliseconds.
    • iterator

      public Iterator<T> iterator()
    • size

      public int size()
    • clear

      public void clear()