public final class EmptyPriorityQueue<T> extends java.lang.Object implements PriorityQueue<T>
| Modifier and Type | Field and Description |
|---|---|
private static PriorityQueue<java.lang.Object> |
INSTANCE |
| Modifier | Constructor and Description |
|---|---|
private |
EmptyPriorityQueue() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T t) |
boolean |
addAll(java.util.Collection<? extends T> c) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
containsTyped(T node)
Same as
Collection.contains(Object) but typed using generics. |
T |
element() |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
static <V> EmptyPriorityQueue<V> |
instance()
Returns an unmodifiable empty
PriorityQueue. |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
boolean |
offer(T t) |
T |
peek() |
T |
poll() |
void |
priorityChanged(T node)
Notify the queue that the priority for
node has changed. |
T |
remove() |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeTyped(T node)
Same as
Collection.remove(Object) but typed using generics. |
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
java.lang.Object[] |
toArray() |
<T1> T1[] |
toArray(T1[] a) |
java.lang.String |
toString() |
private static final PriorityQueue<java.lang.Object> INSTANCE
public static <V> EmptyPriorityQueue<V> instance()
PriorityQueue.public boolean removeTyped(T node)
PriorityQueueCollection.remove(Object) but typed using generics.removeTyped in interface PriorityQueue<T>public boolean containsTyped(T node)
PriorityQueueCollection.contains(Object) but typed using generics.containsTyped in interface PriorityQueue<T>public void priorityChanged(T node)
PriorityQueuenode has changed. The queue will adjust to ensure the priority
queue properties are maintained.priorityChanged in interface PriorityQueue<T>node - An object which is in this queue and the priority may have changed.public int size()
size in interface java.util.Collection<T>public boolean isEmpty()
isEmpty in interface java.util.Collection<T>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<T>public java.util.Iterator<T> iterator()
public java.lang.Object[] toArray()
toArray in interface java.util.Collection<T>public <T1> T1[] toArray(T1[] a)
toArray in interface java.util.Collection<T>public boolean add(T t)
public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<T>public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<T>public boolean addAll(java.util.Collection<? extends T> c)
addAll in interface java.util.Collection<T>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<T>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<T>public void clear()
clear in interface java.util.Collection<T>public boolean equals(java.lang.Object o)
equals in interface java.util.Collection<T>equals in class java.lang.Objectpublic int hashCode()
hashCode in interface java.util.Collection<T>hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object