T
- type in the collectionpublic class ConcurrentPriorityCollection<T extends Serializable> extends PriorityCollection<T>
ReadWriteLock
Constructor and Description |
---|
ConcurrentPriorityCollection(ReadWriteLock readWriteLock,
PriorityCollectionSorting sorting)
Constructs a
ConcurrentPriorityCollection using the specified
ReadWriteLock |
Modifier and Type | Method and Description |
---|---|
void |
add(Iterable<T> c)
Add the arguments and sort according to the PriorityCollectionSorting value for the manager
configuration.
|
void |
add(T... c)
Add the arguments and sort according to the PriorityCollectionSorting value for the manager
configuration.
|
void |
add(T c)
Add the argument and sort according to the PriorityCollectionSorting value for the manager
configuration.
|
void |
clear()
Remove all elements from the collection.
|
PriorityCollection<T> |
getByMIMEType(String mimeType)
Returns the first item matching the mime type
NOTE: The order in which the services are loaded an examined is not deterministic so this method may return different results if the MIME-Type matches more than one item. |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
void |
remove(T... c)
Remove the arguments.
|
void |
remove(T c)
Remove the argument.
|
void |
set(Iterable<T> c) |
void |
set(T... c)
Remove all elements, replace with the arguments and sort according to priority.
|
int |
size() |
String |
toString() |
set
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public ConcurrentPriorityCollection(ReadWriteLock readWriteLock, PriorityCollectionSorting sorting)
ConcurrentPriorityCollection
using the specified
ReadWriteLock
readWriteLock
- The ReadWriteLock
that should be used
for locking.sorting
- sorting criterionpublic boolean isEmpty()
isEmpty
in class PriorityCollection<T extends Serializable>
public int size()
size
in class PriorityCollection<T extends Serializable>
public void set(Iterable<T> c)
set
in class PriorityCollection<T extends Serializable>
c
- collection of elements to set. Existing elements will be removed, and the priority
collection will be sorted according to the PriorityCollectionSorting value for the
manager configuration.public void add(Iterable<T> c)
PriorityCollection
add
in class PriorityCollection<T extends Serializable>
c
- list of elements to addpublic void set(T... c)
PriorityCollection
set
in class PriorityCollection<T extends Serializable>
c
- list of elements to setpublic void add(T... c)
PriorityCollection
add
in class PriorityCollection<T extends Serializable>
c
- list of elements to addpublic void add(T c)
PriorityCollection
add
in class PriorityCollection<T extends Serializable>
c
- element to addpublic void remove(T... c)
PriorityCollection
remove
in class PriorityCollection<T extends Serializable>
c
- list of elements to removepublic void remove(T c)
PriorityCollection
remove
in class PriorityCollection<T extends Serializable>
c
- element to removepublic void clear()
PriorityCollection
clear
in class PriorityCollection<T extends Serializable>
public Iterator<T> iterator()
iterator
in interface Iterable<T extends Serializable>
iterator
in class PriorityCollection<T extends Serializable>
public PriorityCollection<T> getByMIMEType(String mimeType)
PriorityCollection
getByMIMEType
in class PriorityCollection<T extends Serializable>
mimeType
- A MIME type to use for choosing an itempublic String toString()
toString
in class PriorityCollection<T extends Serializable>
Copyright © 2020 The University of Manchester. All rights reserved.