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

org.openl.rules.ui.tree.ProjectTreeNode Maven / Gradle / Ivy

There is a newer version: 5.27.9
Show newest version
package org.openl.rules.ui.tree;

import java.util.Collection;
import java.util.Map;
import java.util.TreeMap;

import org.openl.rules.lang.xls.syntax.TableSyntaxNode;

public class ProjectTreeNode {

    private final String[] displayName;
    private final TableSyntaxNode tableSyntaxNode;

    public ProjectTreeNode(String[] displayName, String type, TableSyntaxNode tsn) {
        this.type = type;
        this.displayName = displayName;
        this.tableSyntaxNode = tsn;
    }

    public String getDisplayName(int mode) {
        return displayName[mode];
    }

    public TableSyntaxNode getTableSyntaxNode() {
        return tableSyntaxNode;
    }

    /**
     * Children of current node.
     */
    private Map elements = new TreeMap<>();

    /**
     * String that represent the node type.
     */
    private final String type;

    /**
     * {@inheritDoc}
     */
    public void addChild(Object key, ProjectTreeNode child) {
        elements.put(key, child);
    }

    /**
     * {@inheritDoc}
     */
    public ProjectTreeNode getChild(Object key) {
        return elements.get(key);
    }

    /**
     * {@inheritDoc}
     */
    public Collection getChildren() {
        return getElements().values();
    }

    /**
     * Gets the map of elements.
     *
     * @return map of elements
     */
    public Map getElements() {
        return elements;
    }

    public void setElements(Map elements) {
        this.elements = elements;
    }

    /**
     * {@inheritDoc}
     */
    public String getType() {
        return type;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy