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

📄 hybridserviceitem.java

📁 实现对owl-s描述服务的检索
💻 JAVA
字号:
/*
 * 
 * OWL-S Matchmaker
 * 
 * COPYRIGHT NOTICE
 * 
 * Copyright (C) 2005 DFKI GmbH, Germany
 * Developed by Benedikt Fries, Matthias Klusch
 * 
 * The code is free for non-commercial use only.
 * You can redistribute it and/or modify it under the terms
 * of the Mozilla Public License version 1.1  as
 * published by the Mozilla Foundation at
 * http://www.mozilla.org/MPL/MPL-1.1.txt
 * 
 */
package owlsmx.gui.data;

import java.net.URI;

public class HybridServiceItem extends ServiceItem implements java.io.Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	protected int dom=-1;
	protected double similarity=-1;
	
	public HybridServiceItem(URI uri) {
		super(uri);
	}
	
	public String toString() { 
		String result = "(" + dom + ", " + ( (double)Math.round(similarity*100))/100 + ") " + name; 
		result = result.replaceAll("[\\r\\f]","");
		return result;
	}
	

	public HybridServiceItem(ServiceItem item) {
		this.uri = item.getURI();
		this.fileURI = item.fileURI;
		this.processed = item.processed;
		this.inputs = item.getInputs();
		this.outputs = item.getOutputs();		
		this.name = item.name;
		name = name.replaceAll("[\\r\\f]","");
	}
	
	public HybridServiceItem(HybridServiceItem item) {
		this.uri = item.getURI();
		this.fileURI = item.fileURI;
		this.processed = item.processed;
		this.inputs = item.getInputs();
		this.outputs = item.getOutputs();
		this.name = item.name;
		name = name.replaceAll("[\\r\\f]","");
		this.dom = item.getDegreeOfMatch();
		this.similarity = item.getSyntacticSimilarity();		
	}
	
	public int getDegreeOfMatch() {
		return dom;
	}
	
	public void setDegreeOfMatch(int dom) {
		this.dom = dom;
	}
	
	public double getSyntacticSimilarity() {
		return similarity;
	}
	
	public void setSyntacticSimilarity(double similarity) {
		this.similarity = similarity;
	}
	
	public int compareTo(Object obj) {
		if (!this.getClass().equals(obj.getClass()))
			return 1;
		HybridServiceItem item = (HybridServiceItem) obj;
		if ( (dom < item.dom) || ((dom == item.dom) && (similarity<item.similarity)) )
				return -1;
		if ( ( (dom == item.dom) && (similarity == item.similarity) && (uri.equals(item.uri)) ) &&
				(this.uri.equals(item.uri)) && (this.fileURI.equals(item.fileURI)) )
			return 0;
		return -1;
	}	


}

⌨️ 快捷键说明

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