T
- the element-typepublic class WithPriority<T> extends Object implements Comparable<WithPriority<T>>
T
to ensure priority is given when the flag gpu==true
.
The priority exists via an ordering of elements, where elements with flag gpu==true
always precede those with gpu==false
.
Constructor and Description |
---|
WithPriority(T element,
boolean gpu) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
int |
compareTo(WithPriority<T> other)
Orders so that
gpu==true has higher priority in queue to gpu==false . |
boolean |
equals(Object o) |
T |
get()
Gets the underlying element stored in the structure.
|
int |
hashCode() |
boolean |
isGPU()
Is the element returned by
get() associated with a GPU? |
public WithPriority(T element, boolean gpu)
public T get()
public boolean isGPU()
get()
associated with a GPU?public int compareTo(WithPriority<T> other)
gpu==true
has higher priority in queue to gpu==false
.compareTo
in interface Comparable<WithPriority<T>>
protected boolean canEqual(Object other)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.