Package org.spdx.library.model
Class ModelCollection<T>
java.lang.Object
org.spdx.library.model.ModelCollection<T>
- All Implemented Interfaces:
Iterable<Object>
,Collection<Object>
- Direct Known Subclasses:
ModelSet
public class ModelCollection<T> extends Object implements Collection<Object>
Collection of elements stored in a ModelStore
- Author:
- Gary O'Neall
-
Constructor Summary
Constructors Constructor Description ModelCollection(IModelStore modelStore, String documentUri, String id, String propertyName, ModelCopyManager copyManager, Class<?> type)
-
Method Summary
Modifier and Type Method Description boolean
add(Object element)
boolean
addAll(Collection<? extends Object> c)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
String
getDocumentUri()
String
getId()
IModelStore
getModelStore()
String
getPropertyName()
boolean
isEmpty()
Iterator<Object>
iterator()
boolean
remove(Object element)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
int
size()
Object[]
toArray()
<AT> AT[]
toArray(AT[] a)
List<Object>
toImmutableList()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
ModelCollection
public ModelCollection(IModelStore modelStore, String documentUri, String id, String propertyName, @Nullable ModelCopyManager copyManager, @Nullable Class<?> type) throws InvalidSPDXAnalysisException- Parameters:
modelStore
- Storage for the model collectiondocumentUri
- SPDX Document URI for a document associated with this model collectionid
- ID for this collection - must be unique within the SPDX documentcopyManager
- if non-null, use this to copy properties when referenced outside this model storetype
- The class of the elements to be stored in the collection if none, null if not known- Throws:
InvalidSPDXAnalysisException
-
-
Method Details
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<T>
-
contains
- Specified by:
contains
in interfaceCollection<T>
-
toImmutableList
-
iterator
-
toArray
- Specified by:
toArray
in interfaceCollection<T>
-
toArray
public <AT> AT[] toArray(AT[] a)- Specified by:
toArray
in interfaceCollection<T>
-
add
- Specified by:
add
in interfaceCollection<T>
-
remove
- Specified by:
remove
in interfaceCollection<T>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
-
addAll
- Specified by:
addAll
in interfaceCollection<T>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<T>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<T>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<T>
-
getModelStore
- Returns:
- the modelStore
-
getDocumentUri
- Returns:
- the documentUri
-
getId
- Returns:
- the id
-
getPropertyName
- Returns:
- the propertyName
-