return res
end
+ # Get the set of properties introduced in 'self'.
+ fun intro_mproperties: Set[MProperty] do
+ var res = new HashSet[MProperty]
+ for mclassdef in mclassdefs do
+ for mpropdef in mclassdef.mpropdefs do
+ if mpropdef.is_intro then res.add(mpropdef.mproperty)
+ end
+ end
+ return res
+ end
+
# Get the list of locally refined methods in 'self'.
fun redef_methods: Set[MMethod] do
var res = new HashSet[MMethod]
return res
end
+ # Get the set of locally refined properties in 'self'.
+ fun redef_mproperties: Set[MProperty] do
+ var res = new HashSet[MProperty]
+ for mclassdef in mclassdefs do
+ for mpropdef in mclassdef.mpropdefs do
+ if not mpropdef.is_intro then res.add(mpropdef.mproperty)
+ end
+ end
+ return res
+ end
+
# Get the list of methods inherited by 'self'.
fun inherited_methods: Set[MMethod] do
var res = new HashSet[MMethod]
return res
end
+ # Get the set of all properties inherited by self
+ fun inherited_mproperties: Set[MProperty] do
+ var res = new HashSet[MProperty]
+ for s in ancestors do
+ for m in s.intro_mproperties do
+ if not self.intro_mproperties.has(m) and not self.redef_mproperties.has(m) then res.add(m)
+ end
+ end
+ return res
+ end
+
# Get the list of all virtual types available in 'self'.
fun virtual_types: Set[MVirtualTypeProp] do
var res = new HashSet[MVirtualTypeProp]
private var mclass: MClass
private var mbuilder: ModelBuilder
private var nitdoc: Nitdoc
+ private var vtypes = new HashSet[MVirtualTypeDef]
+ private var consts = new HashSet[MMethodDef]
+ private var meths = new HashSet[MMethodDef]
+ private var inherited = new HashSet[MPropDef]
init(mclass: MClass, nitdoc: Nitdoc, dot_dir: nullable String, source: nullable String) do
self.mclass = mclass
self.nitdoc = nitdoc
self.dot_dir = dot_dir
self.source = source
+ # load properties
+ for mclassdef in mclass.mclassdefs do
+ for mpropdef in mclassdef.mpropdefs do
+ if mpropdef.mproperty.visibility <= none_visibility then continue
+ if mpropdef isa MVirtualTypeDef then vtypes.add(mpropdef)
+ if mpropdef isa MMethodDef then
+ if mpropdef.mproperty.is_init then
+ consts.add(mpropdef)
+ else
+ meths.add(mpropdef)
+ end
+ end
+ end
+ end
+ # get inherited properties
+ for mprop in mclass.inherited_mproperties do
+ var mpropdef = mprop.intro
+ if mprop.visibility <= none_visibility then continue
+ if mprop.intro_mclassdef.mclass.name == "Object" then continue
+ if mpropdef isa MVirtualTypeDef then vtypes.add(mpropdef)
+ if mpropdef isa MMethodDef then
+ if mpropdef.mproperty.is_init then
+ consts.add(mpropdef)
+ else
+ meths.add(mpropdef)
+ end
+ end
+ inherited.add(mpropdef)
+ end
end
redef fun head do
var sorter = new ComparableSorter[MPropDef]
append("<nav class='properties filterable'>")
append("<h3>Properties</h3>")
- # get intro and redef properties
- var vtypes = new HashSet[MVirtualTypeDef]
- var consts = new HashSet[MMethodDef]
- var meths = new HashSet[MMethodDef]
- for mclassdef in mclass.mclassdefs do
- for mpropdef in mclassdef.mpropdefs do
- if mpropdef.mproperty.visibility <= none_visibility then continue
- if mpropdef isa MVirtualTypeDef then vtypes.add(mpropdef)
- if mpropdef isa MMethodDef then
- if mpropdef.mproperty.is_init then
- consts.add(mpropdef)
- else
- meths.add(mpropdef)
- end
- end
- end
- end
- # get inherited properties
- for mprop in mclass.inherited_methods do
- var mpropdef = mprop.intro
- if mprop.visibility <= none_visibility then continue
- if mprop.intro_mclassdef.mclass.name == "Object" then continue
- meths.add(mpropdef)
- end
# virtual types
if vtypes.length > 0 then
var vts = new Array[MVirtualTypeDef]