equalscondition.java

来自「JAVA实现的有限状态自动机。该软件适合Linux环境下安装运行。」· Java 代码 · 共 74 行

JAVA
74
字号
/***************************************************************************** * net.openai.fsm.EqualsCondition ***************************************************************************** * @author  JC on E * @date    11/2/2000 * 2001 OpenAI Labs *****************************************************************************/package net.openai.util.fsm;/** * EqualsCondition class */public final class EqualsCondition extends Condition {    /** The object that we are going to check against. */    private Object target = null;    /**     * Constructs a new EqualsCondition.     */    public EqualsCondition() {    }    /**     * Constructs a new EqualsCondtion with the given target state.     *     * @param targetState The target state of this condition.     */    public EqualsCondition(State targetCondition) {	super(targetCondition);    }    /**     * Constructs a new EqualsCondition with the target <code>target</code>.     * The <code>satisfiedBy</code> method will return true if the passed     * in object is equal to (== operator) the target object.     *     * @param target The target of this equals condition.     */    public EqualsCondition(Object target) {	this.target = target;    }    /**     * Constructs a new EqualsCondition with the target <code>target</code>     * and the given target state.   The <code>satisfiedBy</code> method will     * return true if the passed in object is equal to (== operator) the     * target object.     *     * @param targetState The target state of this condition.     * @param target      The target of this equals condition.     */    public EqualsCondition(State targetState, Object target) {	super(targetState);	this.target = target;    }    /**     * Implemented method for the Condition interface     *     * Called to check if the condition meets the criteria defined by this     * state.  In this case, the condition is met if:<b>     * <code>conditional == target</code><br>     *     * @param condition The object to check.     * @return True if conditional == target, false otherwise.     */    public final boolean satisfiedBy(Object conditional) {	return (target == conditional);    }}

⌨️ 快捷键说明

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