org.mapdb / QueueLong

QueueLong

class QueueLong : Verifiable

FIFO Queue with option to remove element from middle



Types

Node data class Node

Constructors

<init> QueueLong(store: Store, tailRecid: Long, headRecid: Long, headPrevRecid: Long)

FIFO Queue with option to remove element from middle

Properties

head var head: Long
headPrev var headPrev: Long
headPrevRecid val headPrevRecid: Long
headRecid val headRecid: Long
store val store: Store
tail var tail: Long
tailRecid val tailRecid: Long

Functions

bump fun bump(nodeRecid: Long, newTimestamp: Long): Unit
clear fun clear(): Unit
forEach fun forEach(body: (Long, Long, Long) -> Unit): Unit
printContent fun printContent(out: PrintStream): Unit
put fun put(timestamp: Long, value: Long): Long
fun put(timestamp: Long, value: Long, nodeRecid: Long): Unit

puts Node into queue, returns recid which represents this node

remove fun remove(nodeRecid: Long, removeNode: Boolean): Node
size fun size(): Long
take fun take(): Node?
takeUntil fun takeUntil(f: QueueLongTakeUntil): Unit

Takes elements, until callback returns true. When callback returns false, last node is preserved in Queue

valuesArray fun valuesArray(): LongArray
verify fun verify(): Unit

Companion Object Functions

make fun make(store: Store = StoreTrivial(), tailRecid: Long = store.put(store.put(null, Node.SERIALIZER), Serializer.RECID), headRecid: Long = store.put(store.get(tailRecid, Serializer.RECID), Serializer.RECID), headPrevRecid: Long = store.put(0L, Serializer.RECID)): QueueLong