Used to pass arguments by reference.
Also used when one want to give a single element when a full collection is expected
core :: Ref :: defaultinit
functional :: test_iter_extras $ Ref :: ==
Haveself
and other
the same value?
serialization :: serialization_core $ Ref :: core_serialize_to
Actual serialization ofself
to serializer
serialization :: serialization_core $ Ref :: from_deserializer
Create an instance of this class from thedeserializer
core :: Collection :: CONCURRENT
Type of the concurrent variant of this collectionserialization :: 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.
core :: Collection :: combinations
Allr
-length combinations on self (in same order) without repeated elements.
core :: Collection :: combinations_with_replacement
Allr
-length combination on self (in same order) with repeated elements.
serialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
core :: Object :: defaultinit
core :: Ref :: defaultinit
core :: Collection :: defaultinit
serialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
core :: Collection :: has_all
Does the collection contain at least each element ofother
?
core :: Collection :: has_any
Does the collection contain at least one element ofother
?
core :: Collection :: has_exactly
Does the collection contain exactly all the elements ofother
?
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).core :: Collection :: permutations
Allr
-length permutations on self (all possible ordering) without repeated elements.
core :: Collection :: product
Cartesian product, overr
times self
.
serialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
core :: Collection :: to_concurrent
Wrapsself
in a thread-safe collection
core :: Collection :: to_counter
Create and fill up a counter with the elements of `self.core :: Collection :: to_curlslist
Convert Collection[String] to CURLSListserialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
core :: Collection :: to_shuffle
Return a new array made of elements in a random order.Serializer::serialize
# A collection that contains only one item.
#
# Used to pass arguments by reference.
#
# Also used when one want to give a single element when a full
# collection is expected
class Ref[E]
super Collection[E]
redef fun first do return item
redef fun is_empty do return false
redef fun length do return 1
redef fun has(an_item) do return item == an_item
redef fun has_only(an_item) do return item == an_item
redef fun count(an_item)
do
if item == an_item then
return 1
else
return 0
end
end
redef fun iterator do return new RefIterator[E](self)
# The stored item
var item: E is writable
end
lib/core/collection/abstract_collection.nit:349,1--381,3
redef class Ref[E]
super Serializable
redef init from_deserializer(v)
do
v.notify_of_creation self
var item = v.deserialize_attribute("item")
init item
end
redef fun core_serialize_to(v)
do
v.serialize_attribute("item", first)
end
end
lib/serialization/serialization_core.nit:286,1--300,3