Package org.spdx.library.model.v2
Class RelatedElementCollection
- java.lang.Object
-
- org.spdx.library.model.v2.RelatedElementCollection
-
- All Implemented Interfaces:
Iterable<SpdxElement>
,Collection<SpdxElement>
public class RelatedElementCollection extends Object implements Collection<SpdxElement>
Collection of SPDX elements related to an SpdxElement- Author:
- Gary O'Neall
-
-
Constructor Summary
Constructors Constructor Description RelatedElementCollection(SpdxElement owningElement, RelationshipType relationshipTypeFilter, String specVersion)
RelatedElementCollection(SpdxElement owningElement, RelationshipType relationshipTypeFilter, String relatedElementTypeFilter, String specVersion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(SpdxElement e)
boolean
addAll(Collection<? extends SpdxElement> c)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
boolean
equals(Object o)
SpdxElement
getOwningElement()
String
getRelatedElementTypeFilter()
org.spdx.core.ModelCollection
getRelationshipCollection()
RelationshipType
getRelationshipTypeFilter()
int
hashCode()
boolean
isEmpty()
Iterator<SpdxElement>
iterator()
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
int
size()
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, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Constructor Detail
-
RelatedElementCollection
public RelatedElementCollection(SpdxElement owningElement, @Nullable RelationshipType relationshipTypeFilter, String specVersion) throws org.spdx.core.InvalidSPDXAnalysisException
- Parameters:
owningElement
-relationshipTypeFilter
- relationship type to filter the results collection on - if null, do not filterspecVersion
- - version of the SPDX spec the object complies with- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
RelatedElementCollection
public RelatedElementCollection(SpdxElement owningElement, @Nullable RelationshipType relationshipTypeFilter, @Nullable String relatedElementTypeFilter, String specVersion) throws org.spdx.core.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 filterspecVersion
- - version of the SPDX spec the object complies with- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
-
Method Detail
-
toImmutableList
public List<SpdxElement> toImmutableList()
-
size
public int size()
- Specified by:
size
in interfaceCollection<SpdxElement>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<SpdxElement>
-
contains
public boolean contains(Object o)
- Specified by:
contains
in interfaceCollection<SpdxElement>
-
iterator
public Iterator<SpdxElement> iterator()
- Specified by:
iterator
in interfaceCollection<SpdxElement>
- Specified by:
iterator
in interfaceIterable<SpdxElement>
-
toArray
public SpdxElement[] toArray()
- Specified by:
toArray
in interfaceCollection<SpdxElement>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfaceCollection<SpdxElement>
-
add
public boolean add(SpdxElement e)
- Specified by:
add
in interfaceCollection<SpdxElement>
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<SpdxElement>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<SpdxElement>
-
addAll
public boolean addAll(Collection<? extends SpdxElement> c)
- Specified by:
addAll
in interfaceCollection<SpdxElement>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interfaceCollection<SpdxElement>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll
in interfaceCollection<SpdxElement>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<SpdxElement>
-
equals
public boolean equals(Object o)
- Specified by:
equals
in interfaceCollection<SpdxElement>
- Overrides:
equals
in classObject
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceCollection<SpdxElement>
- Overrides:
hashCode
in classObject
-
getRelationshipCollection
public org.spdx.core.ModelCollection getRelationshipCollection()
- Returns:
- the relationshipCollection
-
getRelationshipTypeFilter
public RelationshipType getRelationshipTypeFilter()
- Returns:
- the relationshipTypeFilter
-
getRelatedElementTypeFilter
public String getRelatedElementTypeFilter()
- Returns:
- the relatedElementTypeFilter
-
getOwningElement
public SpdxElement getOwningElement()
- Returns:
- the owningElement
-
-