Package jadex.commons.collection
Class LeaseTimeSet.SynchronizedLeaseTimeCollection<E>
- java.lang.Object
-
- jadex.commons.collection.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
-
-
Constructor Summary
Constructors Constructor Description SynchronizedLeaseTimeCollection(ILeaseTimeSet<E> c)SynchronizedLeaseTimeCollection(ILeaseTimeSet<E> c, java.lang.Object mutex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)booleanadd(E e, long leasetime)Add a new entry.booleanaddAll(java.util.Collection<? extends E> coll)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> coll)booleanisEmpty()java.util.Iterator<E>iterator()booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> coll)booleanretainAll(java.util.Collection<?> coll)voidsetRemoveCommand(ICommand<Tuple2<E,java.lang.Long>> cmd)Set the remove cmd.intsize()java.lang.Object[]toArray()<T> T[]toArray(T[] a)java.lang.StringtoString()voidtouch(E e)Update the timestamp of e.voidtouch(E e, long leasetime)Update the timestamp of e.booleanupdate(E e)Add a new entry or update an existing entry.booleanupdate(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
-
-
-
-
Constructor Detail
-
SynchronizedLeaseTimeCollection
public SynchronizedLeaseTimeCollection(ILeaseTimeSet<E> c)
-
SynchronizedLeaseTimeCollection
public SynchronizedLeaseTimeCollection(ILeaseTimeSet<E> c, java.lang.Object mutex)
-
-
Method Detail
-
setRemoveCommand
public void setRemoveCommand(ICommand<Tuple2<E,java.lang.Long>> cmd)
Set the remove cmd.- Specified by:
setRemoveCommandin interfaceILeaseTimeSet<E>
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection<E>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
containsin interfacejava.util.Collection<E>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfacejava.util.Collection<E>
-
iterator
public java.util.Iterator<E> iterator()
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
removein interfacejava.util.Collection<E>
-
containsAll
public boolean containsAll(java.util.Collection<?> coll)
- Specified by:
containsAllin interfacejava.util.Collection<E>
-
addAll
public boolean addAll(java.util.Collection<? extends E> coll)
- Specified by:
addAllin interfacejava.util.Collection<E>
-
removeAll
public boolean removeAll(java.util.Collection<?> coll)
- Specified by:
removeAllin interfacejava.util.Collection<E>
-
retainAll
public boolean retainAll(java.util.Collection<?> coll)
- Specified by:
retainAllin interfacejava.util.Collection<E>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<E>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
add
public boolean add(E e, long leasetime)
Description copied from interface:ILeaseTimeSetAdd a new entry.- Specified by:
addin interfaceILeaseTimeSet<E>- Parameters:
e- The entry.leasetime- The leasetime.- Returns:
- True, if new entry.
-
update
public boolean update(E e)
Description copied from interface:ILeaseTimeSetAdd a new entry or update an existing entry.- Specified by:
updatein interfaceILeaseTimeSet<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:
updatein interfaceILeaseTimeSet<E>- Parameters:
entry- The entry.- Returns:
- True, if new entry.
-
touch
public void touch(E e)
Update the timestamp of e.- Specified by:
touchin interfaceILeaseTimeSet<E>- Parameters:
entry- The entry.
-
touch
public void touch(E e, long leasetime)
Update the timestamp of e.- Specified by:
touchin interfaceILeaseTimeSet<E>- Parameters:
entry- The entry.
-
-