An OrderedTree bound to MEntity.

We introduce a new class so it can be easily refined by tools working with a Model.

Introduced properties

Redefined properties

redef type SELF: MEntityTree

nitc $ MEntityTree :: 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 CONCURRENT: ConcurrentCollection[E]

core :: Collection :: CONCURRENT

Type of the concurrent variant of this collection
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _parents: HashMap[E, nullable E]

ordered_tree :: OrderedTree :: _parents

The parent of each element.
private var _roots: Array[E]

ordered_tree :: OrderedTree :: _roots

The roots of the tree (in sequence)
private var _sub: HashMap[E, Array[E]]

ordered_tree :: OrderedTree :: _sub

The branches of the trees.
fun add(p: nullable E, e: E)

ordered_tree :: OrderedTree :: add

Add a new element e in the tree.
fun add_all(p: nullable E, es: Collection[E])

ordered_tree :: OrderedTree :: add_all

Append all nodes es as children of p.
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.
abstract fun clone: SELF

core :: Cloneable :: clone

Duplicate self
fun combinations(r: Int): Collection[SequenceRead[E]]

core :: Collection :: combinations

All r-length combinations on self (in same order) without repeated elements.
fun combinations_with_replacement(r: Int): Collection[SequenceRead[E]]

core :: Collection :: combinations_with_replacement

All r-length combination on self (in same order) with repeated elements.
fun count(item: nullable Object): Int

core :: Collection :: count

How many occurrences of item are in the collection?
private fun detach(e: E)

ordered_tree :: OrderedTree :: detach

Temporary remove e.
fun display(e: E): String

ordered_tree :: OrderedTree :: display

How to display a specific element of the tree
fun first: E

core :: Collection :: first

Return the first item of the collection
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun has(item: nullable Object): Bool

core :: Collection :: has

Is item in the collection ?
fun has_all(other: Collection[nullable Object]): Bool

core :: Collection :: has_all

Does the collection contain at least each element of other?
fun has_any(other: Collection[nullable Object]): Bool

core :: Collection :: has_any

Does the collection contain at least one element of other?
fun has_exactly(other: Collection[nullable Object]): Bool

core :: Collection :: has_exactly

Does the collection contain exactly all the elements of other?
fun has_only(item: nullable Object): Bool

core :: Collection :: has_only

Is the collection contain only item?
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 is_empty: Bool

core :: Collection :: is_empty

Is there no item in the collection?
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 iterator: Iterator[E]

core :: Collection :: iterator

Get a new iterator on the collection.
fun join(separator: nullable Text, last_separator: nullable Text): String

core :: Collection :: join

Concatenate and separate each elements with separator.
fun length: Int

core :: Collection :: length

Number of items in the collection.
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
fun not_empty: Bool

core :: Collection :: not_empty

Alias for not is_empty.
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 parent(e: E): nullable E

ordered_tree :: OrderedTree :: parent

The parent of the element e
private fun parents: HashMap[E, nullable E]

ordered_tree :: OrderedTree :: parents

The parent of each element.
private fun parents=(parents: HashMap[E, nullable E])

ordered_tree :: OrderedTree :: parents=

The parent of each element.
fun permutations(r: Int): Collection[SequenceRead[E]]

core :: Collection :: permutations

All r-length permutations on self (all possible ordering) without repeated elements.
fun plain_to_s: String

core :: Collection :: plain_to_s

Concatenate elements without separators
fun product(r: Int): Collection[SequenceRead[E]]

core :: Collection :: product

Cartesian product, over r times self.
fun rand: E

core :: Collection :: rand

Return a random element form the collection
fun roots: Array[E]

ordered_tree :: OrderedTree :: roots

The roots of the tree (in sequence)
protected fun roots=(roots: Array[E])

ordered_tree :: OrderedTree :: roots=

The roots of the tree (in sequence)
fun sample(length: Int): Array[E]

core :: Collection :: sample

Return a new array made of (at most) length elements randomly chosen.
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
private fun serialize_to_pure_json(v: JsonSerializer)

core :: Collection :: serialize_to_pure_json

Utility to serialize a normal Json array
fun sort_with(comparator: Comparator)

ordered_tree :: OrderedTree :: sort_with

Sort roots and other elements using a comparator method
fun sub: HashMap[E, Array[E]]

ordered_tree :: OrderedTree :: sub

The branches of the trees.
protected fun sub=(sub: HashMap[E, Array[E]])

ordered_tree :: OrderedTree :: sub=

The branches of the trees.
private fun sub_to_a(e: E, res: Array[E])

ordered_tree :: OrderedTree :: sub_to_a

private fun sub_write_to(o: Writer, e: E, prefix: String)

ordered_tree :: OrderedTree :: sub_write_to

intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun to_a: Array[E]

core :: Collection :: to_a

Build a new array from a collection
abstract fun to_concurrent: CONCURRENT

core :: Collection :: to_concurrent

Wraps self in a thread-safe collection
fun to_counter: Counter[E]

core :: Collection :: to_counter

Create and fill up a counter with the elements of `self.
fun to_curlslist: CURLSList

core :: Collection :: to_curlslist

Convert Collection[String] to CURLSList
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_shuffle: Array[E]

core :: Collection :: to_shuffle

Return a new array made of elements in a random order.
protected fun write_line(o: Writer, e: E, prefix: String)

ordered_tree :: OrderedTree :: write_line

Write the full line for the element e in o.
abstract fun write_to(stream: Writer)

core :: Writable :: write_to

Write itself to a stream
fun write_to_bytes: Bytes

core :: Writable :: write_to_bytes

Like write_to but return a new Bytes (may be quite large)
fun write_to_file(filepath: String)

core :: Writable :: write_to_file

Like write_to but take care of creating the file
fun write_to_string: String

core :: Writable :: write_to_string

Like write_to but return a new String (may be quite large).
package_diagram nitc::MEntityTree MEntityTree ordered_tree::OrderedTree OrderedTree nitc::MEntityTree->ordered_tree::OrderedTree core::Writable Writable ordered_tree::OrderedTree->core::Writable core::Collection Collection ordered_tree::OrderedTree->core::Collection core::Cloneable Cloneable ordered_tree::OrderedTree->core::Cloneable ...core::Writable ... ...core::Writable->core::Writable ...core::Collection ... ...core::Collection->core::Collection ...core::Cloneable ... ...core::Cloneable->core::Cloneable

Ancestors

interface Cloneable

core :: Cloneable

Something that can be cloned
interface Collection[E: nullable Object]

core :: Collection

The root of the collection hierarchy.
interface Object

core :: Object

The root of the class hierarchy.
interface Writable

core :: Writable

Things that can be efficienlty written to a Writer

Parents

class OrderedTree[E: Object]

ordered_tree :: OrderedTree

Generic structure to manage and display an ordered tree

Class definitions

nitc $ MEntityTree
# An OrderedTree bound to MEntity.
#
# We introduce a new class so it can be easily refined by tools working
# with a Model.
class MEntityTree
	super OrderedTree[MEntity]
end
src/model/model.nit:147,1--153,3