Class TreeGraph<T>
java.lang.Object
io.openml.gearbox.algorithms.binarytree.TreeGraph<T>
- Type Parameters:
T- The type of value store in the node of the original tree
-
Method Summary
Modifier and TypeMethodDescriptionReturns an immutable list of all neighbors to which the specifiedTreeNodekey is mapped, orCollections.emptyList()if thisTreeGraphmap contains no mapping for the key.keySet()Returns an immutableSetview of the all nodes of the original tree.static <T> TreeGraph<T> Creates the map view of a specified tree.
-
Method Details
-
of
Creates the map view of a specified tree.- Type Parameters:
T- The type of value store in the node of the original tree- Parameters:
root- The root of the provided tree- Returns:
- a new
TreeGraphinstance - Throws:
NullPointerException- if therootisnull
-
get
Returns an immutable list of all neighbors to which the specifiedTreeNodekey is mapped, orCollections.emptyList()if thisTreeGraphmap contains no mapping for the key.More formally, if this map contains a mapping from a key
kto a listlsuch that(key == null ? k == null : key.equals(k)), then this method returnsl; otherwise it returnsCollections.emptyList(). (There can be at most one such mapping.)- Parameters:
key- TheTreeNodekey whose associated list of values is to be returned- Returns:
- the list of neighbors to which the specified key is mapped, or
Collections.emptyList()if this map contains no mapping for the key - Throws:
NullPointerException- if the specified key isnull
-
keySet
-