Package eu.bandm.tools.dtd
Class Statistics
java.lang.Object
eu.bandm.tools.dtd.Statistics
Collects and analyses references between elements, attlists and entities.
Searches for common attributes and possible abstract declarations.
Offers some printstream-based visualisation of the results.
For simplicity, all result fields are declared "public", but meant only to be read. (Since these statistic data is mostly for information purpose, protection mechanisms seem an over-do. Every map and every set must be wrapped into an "immutable" one, etc.!)
Sets/maps which do MIX elements, GEs, PEs, etc., represent all those by their "canonical key", see
The same encoding has already been employed by the
The statistic data heavily relies on this field, and on the partial analyses done by
For simplicity, all result fields are declared "public", but meant only to be read. (Since these statistic data is mostly for information purpose, protection mechanisms seem an over-do. Every map and every set must be wrapped into an "immutable" one, etc.!)
Sets/maps which do MIX elements, GEs, PEs, etc., represent all those by their "canonical key", see
Utilities.canonicalKey_element(String)
,
Utilities.canonicalKey_attribute(String)
and
Utilities.canonicalKey_entity(String,boolean)
.
The same encoding has already been employed by the
TunedDTDParser
when the field DTD.Dtd.entityUsage
is filled.
It collects all references to PEs and GEs from
Element content models (PE only), attribute lists(PE),
attribute value contents(GE), PE definition text (PE / GE) and
GE definition text (GE):
The statistic data heavily relies on this field, and on the partial analyses done by
ElementIndex
and AttlistIndex
.-
Field Summary
Modifier and TypeFieldDescriptionfinal Map<DTD.Element,
Set<DTD.AttDef>> Elements which have (nested) disjunctions of singletons as contents model.final Set<DTD.Entity>
Entities used for content models, possibly candidates for abstract elements.final Set<DTD.Entity>
Entities used for content models, possibly candidates for abstract elements when removing decoration.protected DTD.Dtd
final Multimap<DTD.Element,
String> Elements refer to attributes in their attlist.final Multimap<DTD.Element,
DTD.Element> Left elements refer to right elements in their contents model.Elements refer directly to entity in their contents model.Element names referred to, but not defined.Entities contained directly OR IN-directly in content models.final Map<String,
DTD.Entity> Map of keys (with prefix) to the general entity.final Map<String,
DTD.Entity> Map of names (without prefix) to the general entity.GEs referred to, but not defined.boolean
boolean
boolean
boolean
boolean
boolean
boolean
protected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>>
final Map<String,
DTD.Entity> Map of keys (with prefix) to the parameter entity.final Map<String,
DTD.Entity> Map of names (without prefix) to the parameter entity.PEs referred to, but not defined.Transitive closure of reference relations (from ent/el/att/ent) into entities. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Returns whether the contents are an undecorated choice of undecorated singletons, and thus are a candidate for an "abstract" Tdom class.protected void
void
void
update
(DTD.Dtd dtd, MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg)
-
Field Details
-
dtd
-
msg
-
elementIndex
-
attlistIndex
-
has_pi
public boolean has_pi -
has_comment
public boolean has_comment -
has_insert
public boolean has_insert -
has_element
public boolean has_element -
has_attlist
public boolean has_attlist -
has_pe
public boolean has_pe -
has_ge
public boolean has_ge -
piTargets
-
el2el
Left elements refer to right elements in their contents model. -
abstractCandidates
Elements which have (nested) disjunctions of singletons as contents model. -
abstractEntityCandidates
Entities used for content models, possibly candidates for abstract elements. -
abstractEntityCandidates_decorated
Entities used for content models, possibly candidates for abstract elements when removing decoration. -
el2att
Elements refer to attributes in their attlist. Attributes encoded with name and type by usingUtilities.canonicalKey_att_name_type(AttDef)
. -
peByName
Map of names (without prefix) to the parameter entity. -
peByKey
Map of keys (with prefix) to the parameter entity. -
geByName
Map of names (without prefix) to the general entity. -
geByKey
Map of keys (with prefix) to the general entity. -
element2topLevelEntity
Elements refer directly to entity in their contents model. -
entityKeysUsedForContent
Entities contained directly OR IN-directly in content models. -
transitiveUsage
Transitive closure of reference relations (from ent/el/att/ent) into entities. -
elRefsUndef
Element names referred to, but not defined. -
peRefsUndef
PEs referred to, but not defined. FIXME MISSING -
geRefsUndef
GEs referred to, but not defined. FIXME MISSING
-
-
Constructor Details
-
Statistics
public Statistics()
-
-
Method Details
-
check_abstract_precondition
Returns whether the contents are an undecorated choice of undecorated singletons, and thus are a candidate for an "abstract" Tdom class. -
checkUpdated
protected void checkUpdated() -
update
-
printOrdered
-