Package sootup.analysis.intraprocedural
Class UniverseSortedPriorityQueue<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
sootup.analysis.intraprocedural.UniverseSortedPriorityQueue<E>
- Type Parameters:
E
- the type of elements held in the universe
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Queue<E>
TLDR: this class implements sorting a priorityquueue based on the order of items in a List (i.e.
the Universe") it seems equivalent to using a PriorityQueue with a custom Comparator sorting the
items ordered using the same Universe. as a rough guess this class is faster as the sorting-call
seems to be called just once vs multiple times TODO: check that.
A fixed size priority queue based on bitsets. The elements of the priority queue are ordered
according to a given universe. This priority queue does not permit null
elements.
Inserting of elements that are not part of the universe is also permitted (doing so will result
in a NoSuchElementException
).
- Author:
- Steven Lambeth
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
final boolean
boolean
isEmpty()
static <E> UniverseSortedPriorityQueue<E>
Creates a new empty priority queuestatic <E> UniverseSortedPriorityQueue<E>
Creates a new full priority queuefinal boolean
final E
peek()
final E
poll()
final boolean
Methods inherited from class java.util.AbstractQueue
addAll, clear, element, remove
Methods inherited from class java.util.AbstractCollection
containsAll, iterator, removeAll, retainAll, size, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
containsAll, equals, hashCode, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Field Details
-
universe
-
ordinalMap
-
-
Method Details
-
peek
-
poll
-
add
- Specified by:
add
in interfaceCollection<E>
- Specified by:
add
in interfaceQueue<E>
- Overrides:
add
in classAbstractQueue<E>
- Throws:
NoSuchElementException
- if e not part of the universeNullPointerException
- if e isnull
-
offer
- Throws:
NoSuchElementException
- if e not part of the universeNullPointerException
- if e isnull
-
remove
- Specified by:
remove
in interfaceCollection<E>
- Overrides:
remove
in classAbstractCollection<E>
-
contains
- Specified by:
contains
in interfaceCollection<E>
- Overrides:
contains
in classAbstractCollection<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<E>
- Overrides:
isEmpty
in classAbstractCollection<E>
-
of
Creates a new full priority queue- Type Parameters:
E
-- Parameters:
universe
-- Returns:
-
noneOf
Creates a new empty priority queue- Type Parameters:
E
-- Parameters:
universe
-- Returns:
-