Package org.onosproject.store.service
Interface TransactionalSet<E>
-
- Type Parameters:
E- type of element.
public interface TransactionalSet<E>Transactional Set data structure.A TransactionalSet is implemented with the help of TransactionalMap data structure. All operations performed on this set within a transaction boundary are invisible externally until the point when the transaction commits. A commit usually succeeds in the absence of conflicts.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanadd(E e)Adds the specified element to this set if it is not already present (optional operation).booleancontains(E e)Returnstrueif this set contains the specified element.booleanremove(E e)Removes the specified element from this set if it is present (optional operation).
-
-
-
Method Detail
-
add
boolean add(E e)
Adds the specified element to this set if it is not already present (optional operation). More formally, adds the specified elementeto this set if the set contains no elemente2such that(e==null ? e2==null : e.equals(e2)). If this set already contains the element, the call leaves the set unchanged and returnsfalse. In combination with the restriction on constructors, this ensures that sets never contain duplicate elements.- Parameters:
e- element to be added to this set- Returns:
trueif this set did not already contain the specified element
-
remove
boolean remove(E e)
Removes the specified element from this set if it is present (optional operation). More formally, removes an elementesuch that(o==null ? e==null : o.equals(e)), if this set contains such an element. Returnstrueif this set contained the element (or equivalently, if this set changed as a result of the call). (This set will not contain the element once the call returns.)- Parameters:
e- element to be removed to this set- Returns:
trueif this set contained the specified element
-
contains
boolean contains(E e)
Returnstrueif this set contains the specified element. More formally, returnstrueif and only if this set contains an elementesuch that(o==null ? e==null : o.equals(e)).- Parameters:
e- element whose presence in this set is to be tested- Returns:
trueif this set contains the specified element- Throws:
ClassCastException- if the type of the specified element is incompatible with this setNullPointerException- if the specified element is null and this set does not permit null elements
-
-