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

📄 conceptdisjunction.java

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

import java.util.*;
import java.awt.Graphics;

/**
 * This class represents the disjunction between two concepts, that is no individual
 * can be instance of the two concepts. 
 *
 * @author Fr閐閞ic F黵st
 */
public class ConceptDisjunction extends AxiomSchemaTwo{
	
	public ConceptDisjunction(ConceptType c1,ConceptType c2){
		super(CGConstants.getConceptDisjunctionTerms(),c1,c2);
	}
	
	public void paint(Graphics g,Language l){
		GraphicsToolkit.drawLinkedCrossCircle(g,super.cp1.x,super.cp1.y,super.cp2.x,super.cp2.y,CGConstants.DISJUNCTION_COLOR,super.cp1.getBounds(g,l),super.cp2.getBounds(g,l));
	}
	
	/** Two primitives can be in disjunction if they are concepts, and if they are
	 *  not in isA relation. */	
	public boolean isValid(){
		return ((cp1 instanceof ConceptType) &&
			    (cp2 instanceof ConceptType) &&
			    !cp1.isA(cp2) && !cp2.isA(cp1));
	}
	
	public Axiom getAxiomForm(){
		return null;
	}
	
	public LinkedList getOperationalForm(Ontology onto,Language l){
		return new LinkedList();
	}
	
	/** Returns from the given list of concept types the list of those that can
	 *  be linked to the given concept type by a disjunction. */
	public static LinkedList getLinkablePrimitives(Collection conceptTypes, ConceptType ct){
		LinkedList result = new LinkedList();
		for(Iterator i = conceptTypes.iterator();i.hasNext();){
			ConceptType ctTemp = (ConceptType) i.next();
			ConceptDisjunction cd = new ConceptDisjunction(ct,ctTemp);
			if(cd.isValid()) result.add(ctTemp);
			cd.destroy();
		}
		return result;
	}
	
}

⌨️ 快捷键说明

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