Companion

object Companion

Layout-output id codec.

IDs pack three values into a single Long:

  • bits 0-31: per-tree key id (from getId)

  • bits 32-34: OutputUnitType (3 bits; values are 0..4)

  • bits 35+: componentTreeId

encodeId and decodeType are inverses — keep them in sync if the layout changes.

Functions

Link copied to clipboard

Extracts the OutputUnitType from an id produced by encodeId. The mask is required because the bits above TYPE_SHIFT also carry the componentTreeId.

Link copied to clipboard
fun encodeId(keyId: Int, type: Int, componentTreeId: Int): Long

Packs keyId, type, and componentTreeId into a single layout-output id.