Package org.spdx.library.model
Class RelatedElementCollection
java.lang.Object
org.spdx.library.model.RelatedElementCollection
- All Implemented Interfaces:
Iterable<SpdxElement>,Collection<SpdxElement>
public class RelatedElementCollection extends Object implements Collection<SpdxElement>
- Author:
- gary
-
Constructor Summary
Constructors Constructor Description RelatedElementCollection(SpdxElement owningElement, RelationshipType relationshipTypeFilter)RelatedElementCollection(SpdxElement owningElement, RelationshipType relationshipTypeFilter, String relatedElementTypeFilter) -
Method Summary
Modifier and Type Method Description booleanadd(SpdxElement e)booleanaddAll(Collection<? extends SpdxElement> c)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)booleanequals(Object o)SpdxElementgetOwningElement()StringgetRelatedElementTypeFilter()ModelCollection<Relationship>getRelationshipCollection()RelationshipTypegetRelationshipTypeFilter()inthashCode()booleanisEmpty()Iterator<SpdxElement>iterator()booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()SpdxElement[]toArray()<T> T[]toArray(T[] a)List<SpdxElement>toImmutableList()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
RelatedElementCollection
public RelatedElementCollection(SpdxElement owningElement, @Nullable RelationshipType relationshipTypeFilter) throws InvalidSPDXAnalysisException- Parameters:
owningElement-relationshipTypeFilter- relationship type to filter the results collection on - if null, do not filter- Throws:
InvalidSPDXAnalysisException
-
RelatedElementCollection
public RelatedElementCollection(SpdxElement owningElement, @Nullable RelationshipType relationshipTypeFilter, @Nullable String relatedElementTypeFilter) throws InvalidSPDXAnalysisException- Parameters:
owningElement-relationshipTypeFilter- relationship type to filter the results collection on - if null, do not filterrelatedElementTypeFilter- filter for only related element types - if null, do not filter- Throws:
InvalidSPDXAnalysisException
-
-
Method Details
-
toImmutableList
-
size
public int size()- Specified by:
sizein interfaceCollection<SpdxElement>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<SpdxElement>
-
contains
- Specified by:
containsin interfaceCollection<SpdxElement>
-
iterator
- Specified by:
iteratorin interfaceCollection<SpdxElement>- Specified by:
iteratorin interfaceIterable<SpdxElement>
-
toArray
- Specified by:
toArrayin interfaceCollection<SpdxElement>
-
toArray
public <T> T[] toArray(T[] a)- Specified by:
toArrayin interfaceCollection<SpdxElement>
-
add
- Specified by:
addin interfaceCollection<SpdxElement>
-
remove
- Specified by:
removein interfaceCollection<SpdxElement>
-
containsAll
- Specified by:
containsAllin interfaceCollection<SpdxElement>
-
addAll
- Specified by:
addAllin interfaceCollection<SpdxElement>
-
removeAll
- Specified by:
removeAllin interfaceCollection<SpdxElement>
-
retainAll
- Specified by:
retainAllin interfaceCollection<SpdxElement>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<SpdxElement>
-
equals
- Specified by:
equalsin interfaceCollection<SpdxElement>- Overrides:
equalsin classObject
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<SpdxElement>- Overrides:
hashCodein classObject
-
getRelationshipCollection
- Returns:
- the relationshipCollection
-
getRelationshipTypeFilter
- Returns:
- the relationshipTypeFilter
-
getRelatedElementTypeFilter
- Returns:
- the relatedElementTypeFilter
-
getOwningElement
- Returns:
- the owningElement
-