T
- Type of elements contained by the clusters@Beta @PublicAPI public interface HierarchicCluster<T> extends Cluster<T>
Further division is also possibly hierarchic. The further division is represented by the child clusters, returned
by clusters()
.
Leaves (elements referenced by this cluster but not by others) are also directly available
The represented group is immutable, so List
modification operators are not supported, they throw
UnsupportedOperationException
upon calling.
Please note that this interface is marked with @Beta annotation, so it can be subject of incompatible changes or removal in later releases.
Modifier and Type | Method and Description |
---|---|
List<? extends HierarchicCluster<T>> |
clusters()
Access further grouping of the represented elements.
|
int |
depth()
Distance from the associated root.
|
int |
height()
Distance from the farthest leave.
|
int |
immediateDescendantsCount()
Sum of child clusters count and leaves count.
|
List<T> |
leaves()
Access immediate leaves associated to this node.
|
Optional<? extends HierarchicCluster<T>> |
parent()
Get parent for non roots.
|
memberCount, members, representant
List<? extends HierarchicCluster<T>> clusters()
Note that a hierarchic cluster might represent structures without further divisions: it is valid to contain
Cluster.members()
but not contain clusters()
.
List<T> leaves()
Leaves returned are part of members of this Cluster
(returned by Cluster.members()
) but not
part of any of the child clusters (returned by clusters()
.
Note that representant structure Cluster.representant()
might be part of the leaves of this cluster
or any of its child clusters leaves.
int depth()
d3.hierarchy
node.depth
.depth()
of parent plus oneint height()
d3.hierarchy
node.height
for internal nodes.leaves()
but no child clusters()
, otherwise the
maximum of the child clusters height()
plus one.int immediateDescendantsCount()
Optional<? extends HierarchicCluster<T>> parent()