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

com.github.andyshao.data.structure.Tree Maven / Gradle / Ivy

The newest version!
package com.github.andyshao.data.structure;

import com.github.andyshao.lang.Cleanable;

import java.io.Serializable;

/**
 * Tree
 * @param  data type
 * @param  Node type
 */
public interface Tree> extends Cleanable, Serializable {
    /**
     * Tree node
     * @param  data type
     */
    public interface TreeNode extends Serializable {
        /**
         * Get the data
         * @return the data
         */
        public DATA data();

        /**
         * Set the data
         * @param data the data
         */
        public void data(DATA data);
    }

    @Override
    public abstract void clear();

    /**
     * The root {@link TreeNode}
     * @return {@link TreeNode}
     */
    public abstract N root();

    /**
     * Set teh root {@link TreeNode}
     * @param node {@link TreeNode}
     */
    public abstract void root(N node);

    /**
     * Get the size number of the {@link Tree}
     * @return the size number
     */
    public abstract int size();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy