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 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
-
-
-
-
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:
setRemoveCommand
in interfaceILeaseTimeSet<E>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<E>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<E>
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfacejava.util.Collection<E>
-
iterator
public java.util.Iterator<E> iterator()
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<E>
-
containsAll
public boolean containsAll(java.util.Collection<?> coll)
- Specified by:
containsAll
in interfacejava.util.Collection<E>
-
addAll
public boolean addAll(java.util.Collection<? extends E> coll)
- Specified by:
addAll
in interfacejava.util.Collection<E>
-
removeAll
public boolean removeAll(java.util.Collection<?> coll)
- Specified by:
removeAll
in interfacejava.util.Collection<E>
-
retainAll
public boolean retainAll(java.util.Collection<?> coll)
- Specified by:
retainAll
in interfacejava.util.Collection<E>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<E>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
add
public boolean add(E e, long leasetime)
Description copied from interface:ILeaseTimeSet
Add a new entry.- Specified by:
add
in interfaceILeaseTimeSet<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 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:
update
in interfaceILeaseTimeSet<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 interfaceILeaseTimeSet<E>
- Parameters:
entry
- The entry.
-
touch
public void touch(E e, long leasetime)
Update the timestamp of e.- Specified by:
touch
in interfaceILeaseTimeSet<E>
- Parameters:
entry
- The entry.
-
-