All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codefx.libfx.collection.tree.stream.TreeNode Maven / Gradle / Ivy

The newest version!
package org.codefx.libfx.collection.tree.stream;

import java.util.OptionalInt;

import org.codefx.libfx.collection.tree.navigate.TreeNavigator;

/**
 * Encapsulates an element in a tree.
 * 

* A {@code TreeNode} is useful to create a {@link TreeIterationStrategy} together with a {@link TreeNavigator}. The * node's child index is stored in the node to reduce the number of {@link TreeNavigator#getChildIndex(Object) * getChildIndex} calls made to the navigator. * * @param * the type of the contained element */ interface TreeNode { /** * @return the encapsulated element */ E getElement(); /** * @return the index of the node within the list of children of its parent */ OptionalInt getChildIndex(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy