contextofuse.java

来自「toocom源代码,主要应用在本体匹配方面!」· Java 代码 · 共 67 行

JAVA
67 行
字号
package toocom.ocgl;

import java.util.*;

/**
 * This class represents the context of use of the axioms in the ontology. The available context
 * of use are inferential/explicit, inferential/implicit, checking/implicit and checking/explicit.
 *
 * @author Fr閐閞ic F黵st
 */
public class ContextOfUse extends NamedObject{
	
	private boolean inferential;
	private boolean explicit;
	
	public ContextOfUse(boolean inferential, boolean explicit){
		super();
		this.inferential = inferential;
		this.explicit = explicit;
		if(inferential){
			if(explicit) this.setTerms(CGConstants.getInferentialExpliciteTerms());
			else this.setTerms(CGConstants.getInferentialImpliciteTerms());
		}
		else{
			if(explicit) this.setTerms(CGConstants.getValidationExpliciteTerms());
			else this.setTerms(CGConstants.getValidationImpliciteTerms());
		}
	}
	
	/** Returns a list of all available contexts of use. */
	public static LinkedList getAllAvailableContexts(){
		LinkedList result = new LinkedList();
		result.add(new ContextOfUse(true,true));
		result.add(new ContextOfUse(true,false));
		result.add(new ContextOfUse(false,true));
		result.add(new ContextOfUse(false,false));
		return result;
	}
	
	/** Returns a vector with the terms of available contexts of use in the given language. */
	public static Vector getAvailableContexts(Language l){
		Vector result = new Vector();
		ContextOfUse ie = new ContextOfUse(true,true);
		result.add(ie.getTerm(l));
		ContextOfUse ii = new ContextOfUse(true,false);
		result.add(ii.getTerm(l));
		ContextOfUse ce = new ContextOfUse(false,true);
		result.add(ce.getTerm(l));
		ContextOfUse ci = new ContextOfUse(false,false);
		result.add(ci.getTerm(l));
		return result;
	}
	
	public boolean isInferential(){
		return inferential;
	}
	
	public boolean isExplicit(){
		return explicit;
	}
	
	public String toString(Language l){
		return this.getTerm(l);
	}
	
}

⌨️ 快捷键说明

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