Class

open class Class(val pool: ConstantPool, val nameConstant: Int, val superNameConstant: Int, val flags: Short, val interfacesConstants: List<Int>, val subClasses: List<Class>, val methods: List<Method>, val fields: List<Field>, val attributes: List<Attribute>)(source)

A class that represents a class in the bytecode

See Class Specification

Since

0.1.0

Parameters

pool

The ConstantPool of the class

nameConstant

The constant of the name of the class

superNameConstant

The constant of the super name of the class

flags

The flags of the class

interfacesConstants

The constants of the interfaces of the class

subClasses

The subclasses of the class

methods

The methods of the class

fields

The fields of the class

attributes

The attributes of the class

See also

Inheritors

Constructors

Link copied to clipboard
constructor(pool: ConstantPool, nameConstant: Int, superNameConstant: Int, flags: Short, interfacesConstants: List<Int>, subClasses: List<Class>, methods: List<Method>, fields: List<Field>, attributes: List<Attribute>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The attributes of the class

Link copied to clipboard
open val fields: List<Field>

The fields of the class

Link copied to clipboard
open val flags: Short

The flags of the class

Link copied to clipboard

The interfaces of the class

Link copied to clipboard

The constants of the interfaces of the class

Link copied to clipboard

Returns if the class is abstract (Checks if the seventh bit of the flags is set)

Link copied to clipboard

Returns if the class is an annotation (Checks if the ninth bit of the flags is set)

Link copied to clipboard
open val isEnum: Boolean

Returns if the class is an enum (Checks if the tenth bit of the flags is set)

Link copied to clipboard
open val isFinal: Boolean

Returns if the class is final (Checks if the fifth bit of the flags is set)

Link copied to clipboard

Returns if the class is an interface (Checks if the sixth bit of the flags is set)

Link copied to clipboard
open val isObject: Boolean

Returns if the class is an object (Checks if the eleventh bit of the flags is set)

Link copied to clipboard
open val isPrivate: Boolean

Returns if the class is private (Checks if the second bit of the flags is set)

Link copied to clipboard

Returns if the class is protected (Checks if the third bit of the flags is set)

Link copied to clipboard
open val isPublic: Boolean

Returns if the class is public (Checks if the first bit of the flags is set)

Link copied to clipboard
open val isStatic: Boolean

Returns if the class is static (Checks if the fourth bit of the flags is set)

Link copied to clipboard

Returns if the class is synthetic (Checks if the eighth bit of the flags is set)

Link copied to clipboard
open val methods: List<Method>

The methods of the class

Link copied to clipboard
open val name: String

The name of the class

Link copied to clipboard
open val nameConstant: Int

The index of a ConstantPoolEntry.Utf8Constant constant in the ConstantPool that represents the name of the class

Link copied to clipboard
open val pool: ConstantPool

The ConstantPool of the class

Link copied to clipboard
open val subClasses: List<Class>

The subclasses of the class

Link copied to clipboard
open val superName: String

The super name of the class

Link copied to clipboard

The index of a ConstantPoolEntry.Utf8Constant constant in the ConstantPool that represents the super name of the class

Functions

Link copied to clipboard

Dumps the class to a ByteArray

fun dump(stream: DataOutputStream)

Dumps the class to the given stream

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compares this Class to the other object

Link copied to clipboard
open override fun hashCode(): Int

Returns the hash code of this Class