envvalue.java

来自「是有关解释器的.用JAVA编写.可以解释一般的JAVA程序.」· Java 代码 · 共 88 行

JAVA
88
字号
/**
 * This abstract class declares the interface for all values which can be saved
 * in Environments: runtime values, method definitions, variable types...
 * 
 * @see NotFoundValue
 * @see FoundValue
 */
public abstract class EnvValue {
    /**
     * Checks, whether the object represents a found value.
     * 
     * @return true, if the object does not represent a real value
     */
    abstract boolean isNotFound();

    /**
     * Checks, whether the object is a value.
     * 
     * @return default implementation false, needs to be overwritten in subclass
     */
    boolean isValue() {
        return false;
    }

    /**
     * Checks, wether the value is of type <code>boolean</code>.
     * 
     * @return default implementation false, needs to be overwritten in subclass
     */
    boolean isBoolean() {
        return false;
    }

    /**
     * Checks, wether the value is of type <code>int</code>.
     * 
     * @return default implementation false, needs to be overwritten in subclass
     */
    boolean isNumber() {
        return false;
    }

    /**
     * Checks, wether the value is of type <code>direction</code>.
     * 
     * @return default implementation false, needs to be overwritten in subclass
     */
    boolean isDirection() {
        return false;
    }

    /**
     * Checks, wether the value is a reference to a robot.
     * 
     * @return default implementation false, needs to be overwritten in subclass
     */
    boolean isRobotRef() {
        return false;
    }

    /**
     * Checks, wether the value is a value type (for instance int or direction).
     * 
     * @return default implementation false, needs to be overwritten in subclass
     */
    boolean isVariableType() {
        return false;
    }

    /**
     * Checks, wether the value is a valid return type. (void is).
     * 
     * @return default implementation false, needs to be overwritten in subclass
     */
    boolean isResultType() {
        return false;
    }

    /**
     * Checks, wether the value is a method definition.
     * 
     * @return default implementation false, needs to be overwritten in subclass
     */
    boolean isMethod() {
        return false;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?