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

org.ggp.base.util.propnet.architecture.components.Constant Maven / Gradle / Ivy

The newest version!
package org.ggp.base.util.propnet.architecture.components;

import org.ggp.base.util.propnet.architecture.Component;

/**
 * The Constant class is designed to represent nodes with fixed logical values.
 */
@SuppressWarnings("serial")
public final class Constant extends Component
{
    /** The value of the constant. */
    private final boolean value;

    /**
     * Creates a new Constant with value value.
     *
     * @param value
     *            The value of the Constant.
     */
    public Constant(boolean value)
    {
        this.value = value;
    }

    /**
     * Returns the value that the constant was initialized to.
     *
     * @see org.ggp.base.util.propnet.architecture.Component#getValue()
     */
    @Override
    public boolean getValue()
    {
        return value;
    }

    /**
     * @see org.ggp.base.util.propnet.architecture.Component#toString()
     */
    @Override
    public String toString()
    {
        return toDot("doublecircle", "grey", Boolean.toString(value).toUpperCase());
    }

    @Override
    public String getShortName() {
        return Boolean.toString(value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy