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

org.swiftboot.collections.tree.Initiator Maven / Gradle / Ivy

There is a newer version: 2.4.8
Show newest version
package org.swiftboot.collections.tree;

import java.util.List;

/**
 * The elements in the list must have parent-child relationship.
 * The {@link Tree} instance will composite tree structure by tracing parent of all element.
 *
 * @param  Data object.
 * @author swiftech
 * @see Tree
 * @since 2.2
 */
public interface Initiator {

    /**
     * Provide a default root node only if user not provide explicit root node.
     *
     * @return
     */
    T defaultRoot();

    /**
     * Find parent of data object 'current' in data list 'allElement'.
     * If no parent found, just return null.
     *
     * @param allElement
     * @param current
     * @return
     */
    T findParent(List allElement, T current);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy