Collect self parents (direct ancestors)

The concept of parent is abstract at this stage.

Property definitions

nitc :: model_collect $ MEntity :: collect_parents
	# Collect `self` parents (direct ancestors)
	#
	# The concept of parent is abstract at this stage.
	fun collect_parents(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY] is abstract
src/model/model_collect.nit:78,2--81,97

nitc :: model_collect $ MClass :: collect_parents
	# Collect all direct parents of `self`
	redef fun collect_parents(mainmodule, filter) do
		var res = new HashSet[MENTITY]
		if not mainmodule.flatten_mclass_hierarchy.has(self) then return res
		for mclass in in_hierarchy(mainmodule).direct_greaters do
			if mclass == self then continue
			if filter == null or filter.accept_mentity(mclass) then res.add mclass
		end
		return res
	end
src/model/model_collect.nit:663,2--672,4

nitc :: model_collect $ MClassDef :: collect_parents
	redef fun collect_parents(mainmodule, filter) do
		var res = new HashSet[MENTITY]
		var hierarchy = self.in_hierarchy
		if hierarchy == null then return res
		for parent in hierarchy.direct_greaters do
			if parent == self then continue
			if filter == null or filter.accept_mentity(parent) then res.add parent
		end
		return res
	end
src/model/model_collect.nit:992,2--1001,4

nitc :: model_collect $ MPackage :: collect_parents
	# Collect all packages directly imported by `self`
	redef fun collect_parents(mainmodule, filter) do
		var res = new HashSet[MENTITY]
		for mgroup in mgroups do
			for parent in mgroup.collect_parents(mainmodule, filter) do
				var mpackage = parent.mpackage
				if mpackage == self then continue
				if filter == null or filter.accept_mentity(mpackage) then res.add(mpackage)
			end
		end
		return res
	end
src/model/model_collect.nit:270,2--281,4

nitc :: model_collect $ MGroup :: collect_parents
	# Collect all groups directly import by `self`
	redef fun collect_parents(mainmodule, filter) do
		var res = new HashSet[MENTITY]
		for mmodule in mmodules do
			for parent in mmodule.collect_parents(mainmodule, filter) do
				var mgroup = parent.mgroup
				if mgroup == null or mgroup == self then continue
				if filter == null or filter.accept_mentity(mgroup) then res.add(mgroup)
			end
		end
		return res
	end
src/model/model_collect.nit:423,2--434,4

nitc :: model_collect $ MProperty :: collect_parents
	# Collect all direct super definitions of `self`
	redef fun collect_parents(mainmodule, filter) do
		var res = new HashSet[MENTITY]
		for mpropdef in mpropdefs do
			for parent in mpropdef.collect_parents(mainmodule, filter) do
				var mprop = parent.mproperty
				if filter == null or filter.accept_mentity(mprop) then res.add mprop
			end
		end
		return res
	end
src/model/model_collect.nit:1092,2--1102,4

nitc :: model_collect $ MPropDef :: collect_parents
	# Collect only the next definition of `self`
	redef fun collect_parents(mainmodule, filter) do
		var res = new HashSet[MENTITY]
		var mpropdef = self
		while not mpropdef.is_intro do
			mpropdef = mpropdef.lookup_next_definition(mclassdef.mmodule, mclassdef.bound_mtype)
			res.add mpropdef
		end
		return res
	end
src/model/model_collect.nit:1160,2--1169,4

nitc :: model_collect $ MModule :: collect_parents
	# Collect all modules directly imported by `self`
	redef fun collect_parents(mainmodule, filter) do
		var res = new HashSet[MENTITY]
		for mentity in in_importation.direct_greaters do
			if mentity == self then continue
			if filter == null or filter.accept_mentity(mentity) then res.add mentity
		end
		return res
	end
src/model/model_collect.nit:489,2--497,4