⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 axiomschematwo.java

📁 toocom源代码,主要应用在本体匹配方面!
💻 JAVA
字号:
package toocom.ocgl;

import java.util.*;

/**
 * This class represents the axiom schemata that deal with two primitives. 
 *
 * @author Fr閐閞ic F黵st
 */
public abstract class AxiomSchemaTwo extends AxiomSchema{
	
	protected ConceptualPrimitive cp1,cp2;
	
	public AxiomSchemaTwo(Terms t, ConceptualPrimitive cp1,ConceptualPrimitive cp2){
		super(t);
		this.getTerms().appendWithSeparator(cp1.getTerms(),CGConstants.AXIOM_SCHEMA_NAME_SEPARATOR);
		this.getTerms().appendWithSeparator(cp2.getTerms(),CGConstants.AXIOM_SCHEMA_NAME_SEPARATOR);
		this.cp1 = cp1;
		this.cp2 = cp2;
		this.cp1.addAxiomSchema(this);
		this.cp2.addAxiomSchema(this);
	}
	
	/** Returns true if the axiom schema links cp. */
	public boolean links(ConceptualPrimitive cp){
		return (cp1.equals(cp) || cp2.equals(cp));
	}
	
	public void destroy(){
		cp1.removeAxiomSchema(this);
		cp2.removeAxiomSchema(this);
	}
	
	/** Returns the other primitive linked by the axiom schema, one of the primitive
	 *  is those given as parameter. Return null if the given primitive is not linked 
	 *  by the axiom schema. */
	public ConceptualPrimitive getTheOtherPrimitive(ConceptualPrimitive cp){
		if(cp1.equals(cp)) return cp2;
		if(cp2.equals(cp)) return cp1;
		return null;
	}
	
}
	

⌨️ 快捷键说明

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