true
and false
are the only instances.
Boolean are manipulated trough three special operators:
and
, or
, not
.
Booleans are mainly used by conditional statement and loops.
json :: serialization_write $ Bool :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONmsgpack :: serialization_write $ Bool :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePackandroid :: bundle $ Bool :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
serialization :: Serializable :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONserialization :: Serializable :: accept_msgpack_attribute_counter
Hook to customize the behavior of theAttributeCounter
serialization :: Serializable :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePackserialization :: Serializable :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
serialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
core :: Object :: defaultinit
serialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
serialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraycore :: Object :: output_class_name
Display class name on stdout (debug only).serialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
serialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
Serializer::serialize
serialization :: DirectSerializable
Instances of this class are not delayed and instead serialized immediately
# Native Booleans.
# `true` and `false` are the only instances.
#
# Boolean are manipulated trough three special operators:
# `and`, `or`, `not`.
#
# Booleans are mainly used by conditional statement and loops.
universal Bool
redef fun object_id is intern
redef fun ==(b) is intern
redef fun !=(b) is intern
redef fun output is intern
redef fun hash do return to_i
# 1 if true and 0 if false
fun to_i: Int
do
if self then
return 1
else
return 0
end
end
end
lib/core/kernel.nit:492,1--515,3
redef class Bool super DirectSerializable end
lib/serialization/serialization_core.nit:258,1--45
redef class Bool
redef fun accept_msgpack_serializer(v) do v.stream.write_msgpack_bool self
end
lib/msgpack/serialization_write.nit:256,1--258,3
redef class Bool
redef fun add_to_bundle(bundle, key)
do
bundle.put_boolean(key, self)
end
end
lib/android/bundle/bundle.nit:707,1--712,3