Package org.biopax.paxtools.util
Class BiopaxSafeSet<E extends BioPAXElement>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
org.biopax.paxtools.util.BiopaxSafeSet<E>
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Set<E>
A thread-safe set of BioPAX objects that also prevents adding several elements
having the same URI. It also allows to quickly get a BioPAX
object by URI. This set is used internally by all multiple cardinality
BioPAX object property and inverse property implementations (since v4.2, 2013).
- Author:
- rodche
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
addAll, clear, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArray
-
Constructor Details
-
BiopaxSafeSet
public BiopaxSafeSet()
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceCollection<E extends BioPAXElement>- Specified by:
iteratorin interfaceIterable<E extends BioPAXElement>- Specified by:
iteratorin interfaceSet<E extends BioPAXElement>- Specified by:
iteratorin classAbstractCollection<E extends BioPAXElement>
-
size
public int size()- Specified by:
sizein interfaceCollection<E extends BioPAXElement>- Specified by:
sizein interfaceSet<E extends BioPAXElement>- Specified by:
sizein classAbstractCollection<E extends BioPAXElement>
-
add
- Specified by:
addin interfaceCollection<E extends BioPAXElement>- Specified by:
addin interfaceSet<E extends BioPAXElement>- Overrides:
addin classAbstractCollection<E extends BioPAXElement>
-
contains
- Specified by:
containsin interfaceCollection<E extends BioPAXElement>- Specified by:
containsin interfaceSet<E extends BioPAXElement>- Overrides:
containsin classAbstractCollection<E extends BioPAXElement>
-
get
Gets a BioPAX element by URI.- Parameters:
uri- absolute URI of a BioPAX individual- Returns:
- BioPAX object or null
-