A
WeightedKey
uniquely identifies
a combination (i.e. an aggregation) of one or more node types.
The weight is an indicator for the cost involved in building such an
aggregate (e.g. an aggregation of multiple complex node types with deep
inheritance trees is more costly to build/validate than an aggregation
of two very simple node types with just one property definition each).
A very simple (and not very accurate) approximation of the weight would
be the number of explicitly aggregated node types (ignoring inheritance
and complexity of each involved node type). A better approximation would
be the number of all, explicitly and implicitly (note that
inheritance is also an aggregation) aggregated node types.
The more accurate the weight definition, the more efficient is the
the building of new aggregates.
It is important to note that the weight is not part of the key value,
i.e. it is not considered by the hashCode()
and
equals(Object)
methods. It does however affect the order
of WeightedKey
instances. See
#compareTo(Object)
for more information.
Let's assume we have an aggregation of node types named "b", "a" and "c".
Its key would be "[a, b, c]" and the weight 3 (using the simple
approximation).