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

com.googlecode.paradox.parser.nodes.SQLNode Maven / Gradle / Ivy

There is a newer version: 1.6.3
Show newest version
/*
 * SQLNode.java 03/12/2009 Copyright (C) 2009 Leonardo Alves da Costa This program is free software: you can
 * redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in
 * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a
 * copy of the GNU General Public License along with this program. If not, see .
 */
package com.googlecode.paradox.parser.nodes;

import java.util.Collection;
import java.util.Collections;

/**
 * Stores a SQL node.
 *
 * @author Leonardo Alves da Costa
 * @version 1.1
 * @since 1.0
 */
public class SQLNode {
    
    /**
     * Node childhood.
     */
    private Collection childhood;
    
    /**
     * The node alias.
     */
    protected String alias;
    
    /**
     * The node name.
     */
    protected final String name;
    
    /**
     * Create a new instance.
     *
     * @param name
     *            the node name.
     */
    protected SQLNode(final String name) {
        this.name = name;
    }
    
    /**
     * Create a new instance.
     *
     * @param name
     *            the node name.
     * @param alias
     *            the node alias.
     */
    protected SQLNode(final String name, final String alias) {
        this.name = name;
        this.alias = alias;
    }
    
    /**
     * Gets the node alias.
     *
     * @return the node alias.
     */
    public final String getAlias() {
        return this.alias;
    }
    
    /**
     * Gets the childhood.
     *
     * @return the childhood.
     */
    @SuppressWarnings("unchecked")
    public final Collection getChildhood() {
        return (Collection) this.childhood;
    }
    
    /**
     * Gets the node name.
     *
     * @return the node name.
     */
    public final String getName() {
        return this.name;
    }
    
    /**
     * Sets the node alias.
     *
     * @param alias
     *            the alias name.
     */
    public final void setAlias(final String alias) {
        this.alias = alias;
    }
    
    /**
     * Sets the childhood.
     *
     * @param childhood
     *            the childhood.
     */
    public final void setChildhood(final Collection childhood) {
        this.childhood = Collections.unmodifiableCollection(childhood);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy