icltermwrapper.java
来自「SRI international 发布的OAA框架软件」· Java 代码 · 共 58 行
JAVA
58 行
/*
#=========================================================================
# Copyright 2003 SRI International. All rights reserved.
#
# The material contained in this file is confidential and proprietary to SRI
# International and may not be reproduced, published, or disclosed to others
# without authorization from SRI International.
#
# DISCLAIMER OF WARRANTIES
#
# SRI International MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
# SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SRI International SHALL NOT BE
# LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES
#=========================================================================
Author : shardt
Date: Oct 8, 2003
*/
package com.sri.oaa2.tools.oaatest;
import com.sri.oaa2.icl.*;
/** A wrapper for IclTerm that uses unification for judging equality. So we can make
* a hash-table of UnifiyTerm(IclTerm) that uses unification for equality.
*/
class IclTermWrapper {
IclTermWrapper(IclTerm term) {
this.term = term;
}
IclTerm getTerm() {
return term;
}
// IclTermWrapper wrappers can be reused to avoid allocating lots of objects.
void setTerm(IclTerm term) {
this.term = term;
}
public boolean equals(Object o) {
if (o instanceof IclTermWrapper) {
IclTerm res = Unifier.getInstance().unify(term,((IclTermWrapper)o).getTerm());
return res != null;
}
else {
return false;
}
}
public String toString() {
return term.toString();
}
IclTerm term;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?