Introduced properties

private var _index: Int

more_collections :: UnrolledIterator :: _index

Index of the current item
private var _index_in_node: Int

more_collections :: UnrolledIterator :: _index_in_node

Index within the current node
private var _node: nullable UnrolledNode[E]

more_collections :: UnrolledIterator :: _node

protected fun index=(index: Int)

more_collections :: UnrolledIterator :: index=

Index of the current item
private fun index_in_node: Int

more_collections :: UnrolledIterator :: index_in_node

Index within the current node
private fun index_in_node=(index_in_node: Int)

more_collections :: UnrolledIterator :: index_in_node=

Index within the current node
private fun node: nullable UnrolledNode[E]

more_collections :: UnrolledIterator :: node

private fun node=(node: nullable UnrolledNode[E])

more_collections :: UnrolledIterator :: node=

Redefined properties

redef type SELF: UnrolledIterator[E]

more_collections $ UnrolledIterator :: SELF

Type of this instance, automatically specialized in every class
redef fun core_serialize_to(v: Serializer)

more_collections $ UnrolledIterator :: core_serialize_to

Actual serialization of self to serializer
redef init from_deserializer(v: Deserializer)

more_collections $ UnrolledIterator :: from_deserializer

Create an instance of this class from the deserializer
redef fun index: Int

more_collections $ UnrolledIterator :: index

Index of the current item
redef fun is_ok: Bool

more_collections $ UnrolledIterator :: is_ok

Is there a current item ?
redef fun item: E

more_collections $ UnrolledIterator :: item

The current item.
redef fun next

more_collections $ UnrolledIterator :: next

Jump to the next item.

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun +(other: Iterator[E]): Iterator[E]

core :: Iterator :: +

Combine two iterators.
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 _index: Int

more_collections :: UnrolledIterator :: _index

Index of the current item
private var _index_in_node: Int

more_collections :: UnrolledIterator :: _index_in_node

Index within the current node
private var _node: nullable UnrolledNode[E]

more_collections :: UnrolledIterator :: _node

protected fun accept_json_serializer(v: JsonSerializer)

serialization :: Serializable :: accept_json_serializer

Refinable service to customize the serialization of this class to JSON
protected fun accept_msgpack_attribute_counter(v: AttributeCounter)

serialization :: Serializable :: accept_msgpack_attribute_counter

Hook to customize the behavior of the AttributeCounter
protected fun accept_msgpack_serializer(v: MsgPackSerializer)

serialization :: Serializable :: accept_msgpack_serializer

Hook to customize the serialization of this class to MessagePack
protected fun add_to_bundle(bundle: NativeBundle, key: JavaString)

serialization :: Serializable :: add_to_bundle

Called by []= to dynamically choose the appropriate method according
fun all(pred: Fun1[E, Bool]): Bool

core :: Iterator :: all

Checks if all elements respect a predicate
fun alternate(e: E): Iterator[E]

core :: Iterator :: alternate

Alternate each item with e.
fun any(pred: Fun1[E, Bool]): Bool

core :: Iterator :: any

Checks if at least one element respects a predicate
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.
fun core_serialize_to(serializer: Serializer)

serialization :: Serializable :: core_serialize_to

Actual serialization of self to serializer
fun enumerate: EnumerateIter[E]

core :: Iterator :: enumerate

Iterator that gives the current count and element as a pair
fun filter(pred: Fun1[E, Bool]): FilterIter[E]

core :: Iterator :: filter

Iterator that filters elements by a predicate
fun finish

core :: Iterator :: finish

Post-iteration hook.
fun flat_map(f: Fun1[E, Iterator[Object]]): FlatMapIter[E, Object]

core :: Iterator :: flat_map

Maps every element to a nested structure then flattens it
fun fold(acc: Object, f: Fun2[Object, E, Object]): Object

core :: Iterator :: fold

Folds an iterator from the left
fun fold1(f: Fun2[E, E, E]): E

core :: Iterator :: fold1

Folds and apply two element at a time
fun for_each(f: Proc1[E])

core :: Iterator :: for_each

Apply a mutation function over all elements
init from_deserializer(deserializer: Deserializer)

serialization :: Serializable :: from_deserializer

Create an instance of this class from the deserializer
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.
fun head(length: Int): Iterator[E]

core :: Iterator :: head

Filter: keep only the first length items.
abstract fun index: Int

core :: IndexedIterator :: index

The index of the current item.
protected fun index=(index: Int)

more_collections :: UnrolledIterator :: index=

Index of the current item
private fun index_in_node: Int

more_collections :: UnrolledIterator :: index_in_node

Index within the current node
private fun index_in_node=(index_in_node: Int)

more_collections :: UnrolledIterator :: index_in_node=

Index within the current node
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".
abstract fun is_ok: Bool

core :: Iterator :: is_ok

Is there a current item ?
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.
abstract fun item: E

core :: Iterator :: item

The current item.
fun iterator: Iterator[E]

core :: Iterator :: iterator

Iterate over self
fun map(f: Fun1[E, Object]): MapIter[E, Object]

core :: Iterator :: map

Applies a function to every elements
protected fun msgpack_extra_array_items: Int

serialization :: Serializable :: msgpack_extra_array_items

Hook to request a larger than usual metadata array
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
abstract fun next

core :: Iterator :: next

Jump to the next item.
fun next_by(step: Int)

core :: Iterator :: next_by

Jump to the next item step times.
private fun node: nullable UnrolledNode[E]

more_collections :: UnrolledIterator :: node

private fun node=(node: nullable UnrolledNode[E])

more_collections :: UnrolledIterator :: node=

intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun order_by(f: Fun1[E, Comparable]): OrderedIter[E]

core :: Iterator :: order_by

Generates an Iterator whose elements are sorted by the function
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 select(predicate: Function[E, Bool]): Iterator[E]

core :: Iterator :: select

Filter: reject items that does not meet some criteria.
fun seq_uniq: Iterator[E]

core :: Iterator :: seq_uniq

Filter: reject continuous sequences of duplicates
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
fun serialize_msgpack(plain: nullable Bool): Bytes

serialization :: Serializable :: serialize_msgpack

Serialize self to MessagePack bytes
fun serialize_to(serializer: Serializer)

serialization :: Serializable :: serialize_to

Serialize self to serializer
fun serialize_to_json(plain: nullable Bool, pretty: nullable Bool): String

serialization :: Serializable :: serialize_to_json

Serialize self to JSON
private fun serialize_to_or_delay(v: Serializer)

serialization :: Serializable :: serialize_to_or_delay

Accept references or force direct serialization (using serialize_to)
fun skip(item: E): Iterator[E]

core :: Iterator :: skip

Filter: reject a given item.
fun skip_head(length: Int): Iterator[E]

core :: Iterator :: skip_head

Filter: reject the first length items.
fun skip_tail(length: Int): Iterator[E]

core :: Iterator :: skip_tail

Filter: reject the last length items.
fun sort: Iterator[E]

core :: Iterator :: sort

Filter: sort with default_comparator.
fun sort_with(comparator: Comparator): Iterator[E]

core :: Iterator :: sort_with

Filter: sort with a given comparator.
fun start

core :: Iterator :: start

Pre-iteration hook.
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun tail(length: Int): Iterator[E]

core :: Iterator :: tail

Filter: keep only the last length items.
fun to_a: Array[E]

core :: Iterator :: to_a

Interate on self and build an array
fun to_json: String

serialization :: Serializable :: to_json

Serialize self to plain JSON
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_pretty_json: String

serialization :: Serializable :: to_pretty_json

Serialize self to plain pretty JSON
fun to_s: String

core :: Object :: to_s

User readable representation of self.
fun to_step(step: Int): Iterator[E]

core :: Iterator :: to_step

A decorator around self that advance self a given number of steps instead of one.
fun uniq: Iterator[E]

core :: Iterator :: uniq

Filter: reject duplicates.
package_diagram more_collections::more_collections::UnrolledIterator UnrolledIterator core::IndexedIterator IndexedIterator more_collections::more_collections::UnrolledIterator->core::IndexedIterator serialization::Serializable Serializable more_collections::more_collections::UnrolledIterator->serialization::Serializable core::Iterator Iterator core::IndexedIterator->core::Iterator core::Object Object serialization::Serializable->core::Object ...core::Iterator ... ...core::Iterator->core::Iterator ...core::Object ... ...core::Object->core::Object

Ancestors

interface Iterator[E: nullable Object]

core :: Iterator

Iterators generate a series of elements, one at a time.
interface Object

core :: Object

The root of the class hierarchy.

Parents

interface IndexedIterator[E: nullable Object]

core :: IndexedIterator

Iterators on indexed collections.
interface Serializable

serialization :: Serializable

Instances of this class can be passed to Serializer::serialize

Class definitions

more_collections $ UnrolledIterator
private class UnrolledIterator[E]
	super IndexedIterator[E]

	var list: UnrolledList[E]

	var node: nullable UnrolledNode[E] = list.head_node is lazy

	# Index of the current `item`
	redef var index = 0

	# Index within the current `node`
	var index_in_node: Int = node.head_index is lazy

	redef fun item do return node.items[index_in_node]

	redef fun is_ok do return index < list.length

	redef fun next
	do
		index += 1
		index_in_node += 1

		if index_in_node >= node.tail_index then
			node = node.next
			if node != null then index_in_node = node.head_index
		end
	end
end
lib/more_collections/more_collections.nit:651,1--678,3