Package edu.duke.cs.osprey.coffee.nodedb
Interface FixedIndex<S extends Comparable<S>,T extends FixedIndex.Indexable<S>>
- All Known Implementing Classes:
PriorityDequeFixedIndex
public interface FixedIndex<S extends Comparable<S>,T extends FixedIndex.Indexable<S>>
An index that allows queries for items with high scores,
but drops items with low scores to make extra space.
However, since multiple indices can share the same memory,
it may not always be possible to free up space in this index.
Implementation are NOT thread-safe unless otherwise specified.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds an item to the index.intReturns the max number of items per block.voidclear()Removes all items.dropped()Returns the queue of dropped items.longReturns the number of items that can be added without freeing up space.voidDrops low-scoring items to make more free space, and adds them to the dropped queue.Returns the highest score of any currently stored item.Removes the highest-scoring item currently stored.longsize()Returns the number of items currently stored.
-
Method Details
-
blockCapacity
int blockCapacity()Returns the max number of items per block. -
size
long size()Returns the number of items currently stored. -
freeSpace
long freeSpace()Returns the number of items that can be added without freeing up space. -
add
Adds an item to the index. Returns true if the item was added, false if there wasn't enough space. -
highestScore
S highestScore()Returns the highest score of any currently stored item. -
removeHighest
T removeHighest()Removes the highest-scoring item currently stored. -
freeUpSpace
void freeUpSpace()Drops low-scoring items to make more free space, and adds them to the dropped queue. -
dropped
Returns the queue of dropped items. -
clear
void clear()Removes all items.
-