org.ggp.base.util.propnet.architecture.components.Constant Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alloy-ggp-base Show documentation
Show all versions of alloy-ggp-base Show documentation
A modified version of the GGP-Base library for Alloy.
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);
}
}