All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.shark.internal.IndexedObject.kt Maven / Gradle / Ivy

There is a newer version: 3.0-alpha-8
Show newest version
package shark.internal

import shark.PrimitiveType

internal sealed class IndexedObject {
  abstract val position: Long
  abstract val recordSize: Long

  class IndexedClass(
    override val position: Long,
    val superclassId: Long,
    val instanceSize: Int,
    override val recordSize: Long,
    val fieldsIndex: Int
  ) : IndexedObject()

  class IndexedInstance(
    override val position: Long,
    val classId: Long,
    override val recordSize: Long
  ) : IndexedObject()

  class IndexedObjectArray(
    override val position: Long,
    val arrayClassId: Long,
    override val recordSize: Long
  ) : IndexedObject()

  class IndexedPrimitiveArray(
    override val position: Long,
    primitiveType: PrimitiveType,
    override val recordSize: Long
  ) : IndexedObject() {
    private val primitiveTypeOrdinal: Byte = primitiveType.ordinal.toByte()
    val primitiveType: PrimitiveType
      get() = PrimitiveType.values()[primitiveTypeOrdinal.toInt()]
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy