A instance with attribute (standards objects)

Introduced properties

private var _attributes: Map[MAttribute, Instance]

nitc :: MutableInstance :: _attributes

The values of the attributes
private var _internal_attributes: Pointer

nitc :: MutableInstance :: _internal_attributes

C-array to store pointers to attributes of this Object
fun attributes: Map[MAttribute, Instance]

nitc :: MutableInstance :: attributes

The values of the attributes
protected fun attributes=(attributes: Map[MAttribute, Instance])

nitc :: MutableInstance :: attributes=

The values of the attributes
fun internal_attributes: Pointer

nitc :: MutableInstance :: internal_attributes

C-array to store pointers to attributes of this Object
protected fun internal_attributes=(internal_attributes: Pointer)

nitc :: MutableInstance :: internal_attributes=

C-array to store pointers to attributes of this Object

Redefined properties

redef type SELF: MutableInstance

nitc $ MutableInstance :: SELF

Type of this instance, automatically specialized in every class

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _attributes: Map[MAttribute, Instance]

nitc :: MutableInstance :: _attributes

The values of the attributes
private var _internal_attributes: Pointer

nitc :: MutableInstance :: _internal_attributes

C-array to store pointers to attributes of this Object
private var _mtype: MType

nitc :: Instance :: _mtype

The dynamic type of the instance
private var _vtable: nullable VTable

nitc :: Instance :: _vtable

Associate a runtime instance to its virtual table which contains methods, types etc.
fun attributes: Map[MAttribute, Instance]

nitc :: MutableInstance :: attributes

The values of the attributes
protected fun attributes=(attributes: Map[MAttribute, Instance])

nitc :: MutableInstance :: attributes=

The values of the attributes
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
init defaultinit(mtype: MType)

nitc :: Instance :: defaultinit

fun eq_is(o: Instance): Bool

nitc :: Instance :: eq_is

Return true if self IS o (using the Nit semantic of is)
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
fun internal_attributes: Pointer

nitc :: MutableInstance :: internal_attributes

C-array to store pointers to attributes of this Object
protected fun internal_attributes=(internal_attributes: Pointer)

nitc :: MutableInstance :: internal_attributes=

C-array to store pointers to attributes of this Object
fun is_null: Bool

nitc :: Instance :: is_null

Return true if the instance is null.
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun is_true: Bool

nitc :: Instance :: is_true

Return true if the instance is the true value.
fun mtype: MType

nitc :: Instance :: mtype

The dynamic type of the instance
protected fun mtype=(mtype: MType)

nitc :: Instance :: mtype=

The dynamic type of the instance
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun to_b: Byte

nitc :: Instance :: to_b

Return the integer value if the instance is a byte.
fun to_f: Float

nitc :: Instance :: to_f

Return the integer value if the instance is a float.
fun to_i: Int

nitc :: Instance :: to_i

Return the integer value if the instance is an integer.
fun to_i16: Int16

nitc :: Instance :: to_i16

Return the integer value if the instance is a int16.
fun to_i32: Int32

nitc :: Instance :: to_i32

Return the integer value if the instance is a int32.
fun to_i8: Int8

nitc :: Instance :: to_i8

Return the integer value if the instance is a int8.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
fun to_u16: UInt16

nitc :: Instance :: to_u16

Return the integer value if the instance is a uint16.
fun to_u32: UInt32

nitc :: Instance :: to_u32

Return the integer value if the instance is a uint32.
fun val: nullable Object

nitc :: Instance :: val

The real value encapsulated if the instance is primitive.
fun vtable: nullable VTable

nitc :: Instance :: vtable

Associate a runtime instance to its virtual table which contains methods, types etc.
protected fun vtable=(vtable: nullable VTable)

nitc :: Instance :: vtable=

Associate a runtime instance to its virtual table which contains methods, types etc.
package_diagram nitc::MutableInstance MutableInstance nitc::Instance Instance nitc::MutableInstance->nitc::Instance core::Object Object nitc::Instance->core::Object ...core::Object ... ...core::Object->core::Object

Ancestors

interface Object

core :: Object

The root of the class hierarchy.

Parents

abstract class Instance

nitc :: Instance

An instance represents a value of the executed program.

Class definitions

nitc $ MutableInstance
# A instance with attribute (standards objects)
class MutableInstance
	super Instance

	# The values of the attributes
	var attributes: Map[MAttribute, Instance] = new HashMap[MAttribute, Instance]
end
src/interpreter/naive_interpreter.nit:770,1--776,3

nitc :: virtual_machine $ MutableInstance
# Redef MutableInstance to improve implementation of attributes in objects
redef class MutableInstance

	# C-array to store pointers to attributes of this Object
	var internal_attributes: Pointer
end
src/vm/virtual_machine.nit:877,1--882,3