implement search-marker prototype (limited usage for now)

This commit is contained in:
Kevin Jahns
2020-07-15 22:03:02 +02:00
parent 6e8167fe51
commit 6e3b708599
11 changed files with 628 additions and 187 deletions

View File

@@ -285,9 +285,31 @@ export class Item extends AbstractStruct {
* @type {AbstractContent}
*/
this.content = content
/**
* bit1: keep
* bit2: countable
* bit3: deleted
* bit4: mark - mark node as fast-search-marker
* @type {number} byte
*/
this.info = this.content.isCountable() ? binary.BIT2 : 0
}
/**
* This is used to mark the item as an indexed fast-search marker
*
* @type {boolean}
*/
set marker (isMarked) {
if (((this.info & binary.BIT4) > 0) !== isMarked) {
this.info ^= binary.BIT4
}
}
get marker () {
return (this.info & binary.BIT4) > 0
}
/**
* If true, do not garbage collect this Item.
*/