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
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfinal booleanbooleanisEmpty()static <E> UniverseSortedPriorityQueue<E>Creates a new empty priority queuestatic <E> UniverseSortedPriorityQueue<E>Creates a new full priority queuefinal booleanfinal Epeek()final Epoll()final booleanMethods inherited from class java.util.AbstractQueue
addAll, clear, element, removeMethods inherited from class java.util.AbstractCollection
containsAll, iterator, removeAll, retainAll, size, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
addin interfaceCollection<E>- Specified by:
addin interfaceQueue<E>- Overrides:
addin 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:
removein interfaceCollection<E>- Overrides:
removein classAbstractCollection<E>
-
contains
- Specified by:
containsin interfaceCollection<E>- Overrides:
containsin classAbstractCollection<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E>- Overrides:
isEmptyin 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:
-