
org.codefx.libfx.collection.tree.stream.TreeNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of LibFX Show documentation
Show all versions of LibFX Show documentation
LibFX provides usability classes for Java and JavaFX.
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