T
- type of the collectionpublic class PriorityCollection<T extends Serializable> extends Object implements Iterable<T>, Serializable
Constructor and Description |
---|
PriorityCollection(PriorityCollectionSorting sorting) |
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 t)
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(Set<T> c) |
void |
set(T... c)
Remove all elements, replace with the arguments and sort according to priority.
|
int |
size() |
String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public PriorityCollection(PriorityCollectionSorting sorting)
sorting
- the configuration holder for sort settings.public boolean isEmpty()
public int size()
public void set(Iterable<T> c)
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 set(Set<T> c)
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 set(T... c)
c
- list of elements to setpublic void add(T... c)
c
- list of elements to addpublic void add(T t)
t
- element to addpublic void add(Iterable<T> c)
c
- list of elements to addpublic void remove(T... c)
c
- list of elements to removepublic void remove(T c)
c
- element to removepublic void clear()
public Iterator<T> iterator()
iterator
in interface Iterable<T extends Serializable>
public PriorityCollection<T> getByMIMEType(String mimeType)
mimeType
- A MIME type to use for choosing an itemCopyright © 2020 The University of Manchester. All rights reserved.