?? conceptdisjunction.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 + -