Class LeaseTimeSet.SynchronizedLeaseTimeCollection<E>

  • All Implemented Interfaces:
    ILeaseTimeSet<E>, java.io.Serializable, java.lang.Iterable<E>, java.util.Collection<E>
    Enclosing class:
    LeaseTimeSet<E>

    public static class LeaseTimeSet.SynchronizedLeaseTimeCollection<E>
    extends java.lang.Object
    implements ILeaseTimeSet<E>, java.io.Serializable
    Synchronized lease time collection.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(E e)  
      boolean add​(E e, long leasetime)
      Add a new entry.
      boolean addAll​(java.util.Collection<? extends E> coll)  
      void clear()  
      boolean contains​(java.lang.Object o)  
      boolean containsAll​(java.util.Collection<?> coll)  
      boolean isEmpty()  
      java.util.Iterator<E> iterator()  
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection<?> coll)  
      boolean retainAll​(java.util.Collection<?> coll)  
      void setRemoveCommand​(ICommand<Tuple2<E,​java.lang.Long>> cmd)
      Set the remove cmd.
      int size()  
      java.lang.Object[] toArray()  
      <T> T[] toArray​(T[] a)  
      java.lang.String toString()  
      void touch​(E e)
      Update the timestamp of e.
      void touch​(E e, long leasetime)
      Update the timestamp of e.
      boolean update​(E e)
      Add a new entry or update an existing entry.
      boolean update​(E e, long leasetime)
      Add a new entry or update an existing entry.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Constructor Detail

      • SynchronizedLeaseTimeCollection

        public SynchronizedLeaseTimeCollection​(ILeaseTimeSet<E> c)
      • SynchronizedLeaseTimeCollection

        public SynchronizedLeaseTimeCollection​(ILeaseTimeSet<E> c,
                                               java.lang.Object mutex)
    • Method Detail

      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<E>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<E>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<E>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<E>
      • toArray

        public <T> T[] toArray​(T[] a)
        Specified by:
        toArray in interface java.util.Collection<E>
      • iterator

        public java.util.Iterator<E> iterator()
        Specified by:
        iterator in interface java.util.Collection<E>
        Specified by:
        iterator in interface java.lang.Iterable<E>
      • add

        public boolean add​(E e)
        Specified by:
        add in interface java.util.Collection<E>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<E>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> coll)
        Specified by:
        containsAll in interface java.util.Collection<E>
      • addAll

        public boolean addAll​(java.util.Collection<? extends E> coll)
        Specified by:
        addAll in interface java.util.Collection<E>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> coll)
        Specified by:
        removeAll in interface java.util.Collection<E>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> coll)
        Specified by:
        retainAll in interface java.util.Collection<E>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<E>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • add

        public boolean add​(E e,
                           long leasetime)
        Description copied from interface: ILeaseTimeSet
        Add a new entry.
        Specified by:
        add in interface ILeaseTimeSet<E>
        Parameters:
        e - The entry.
        leasetime - The leasetime.
        Returns:
        True, if new entry.
      • update

        public boolean update​(E e)
        Description copied from interface: ILeaseTimeSet
        Add a new entry or update an existing entry.
        Specified by:
        update in interface ILeaseTimeSet<E>
        Returns:
        True, if new entry.
      • update

        public boolean update​(E e,
                              long leasetime)
        Add a new entry or update an existing entry.
        Specified by:
        update in interface ILeaseTimeSet<E>
        Parameters:
        entry - The entry.
        Returns:
        True, if new entry.
      • touch

        public void touch​(E e)
        Update the timestamp of e.
        Specified by:
        touch in interface ILeaseTimeSet<E>
        Parameters:
        entry - The entry.
      • touch

        public void touch​(E e,
                          long leasetime)
        Update the timestamp of e.
        Specified by:
        touch in interface ILeaseTimeSet<E>
        Parameters:
        entry - The entry.