Package org.onosproject.store.primitives
Class DefaultDistributedSet<E>
- java.lang.Object
-
- org.onosproject.store.service.Synchronous<AsyncDistributedSet<E>>
-
- org.onosproject.store.primitives.DefaultDistributedSet<E>
-
- Type Parameters:
E
- set element type
- All Implemented Interfaces:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Set<E>
,DistributedPrimitive
,DistributedSet<E>
public class DefaultDistributedSet<E> extends Synchronous<AsyncDistributedSet<E>> implements DistributedSet<E>
Implementation ofDistributedSet
that merely delegates to aAsyncDistributedSet
and waits for the operation to complete.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.onosproject.store.service.DistributedPrimitive
DistributedPrimitive.Status, DistributedPrimitive.Type
-
-
Field Summary
-
Fields inherited from interface org.onosproject.store.service.DistributedPrimitive
DEFAULT_OPERATION_TIMEOUT_MILLIS
-
-
Constructor Summary
Constructors Constructor Description DefaultDistributedSet(AsyncDistributedSet<E> asyncSet, long operationTimeoutMillis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E e)
boolean
addAll(java.util.Collection<? extends E> c)
void
addListener(SetEventListener<E> listener)
Registers the specified listener to be notified whenever the set is updated.void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
isEmpty()
java.util.Iterator<E>
iterator()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
void
removeListener(SetEventListener<E> listener)
Unregisters the specified listener.boolean
retainAll(java.util.Collection<?> c)
int
size()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
-
Methods inherited from class org.onosproject.store.service.Synchronous
destroy, name, primitiveType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.onosproject.store.service.DistributedPrimitive
addStatusChangeListener, applicationId, destroy, name, primitiveType, removeStatusChangeListener, statusChangeListeners
-
-
-
-
Constructor Detail
-
DefaultDistributedSet
public DefaultDistributedSet(AsyncDistributedSet<E> asyncSet, long operationTimeoutMillis)
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(java.lang.Object o)
-
iterator
public java.util.Iterator<E> iterator()
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
add
public boolean add(E e)
-
remove
public boolean remove(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
clear
public void clear()
-
addListener
public void addListener(SetEventListener<E> listener)
Description copied from interface:DistributedSet
Registers the specified listener to be notified whenever the set is updated.- Specified by:
addListener
in interfaceDistributedSet<E>
- Parameters:
listener
- listener to notify about set update events
-
removeListener
public void removeListener(SetEventListener<E> listener)
Description copied from interface:DistributedSet
Unregisters the specified listener.- Specified by:
removeListener
in interfaceDistributedSet<E>
- Parameters:
listener
- listener to unregister.
-
-