serviceitem.java

来自「实现对owl-s描述服务的检索」· Java 代码 · 共 94 行

JAVA
94
字号
/*
 * 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;
import java.util.HashSet;
import java.util.Set;
import owlsmx.gui.util.ServiceLoader;
import owlsmx.gui.util.ServiceLoader.ServiceContent;

public class ServiceItem implements java.io.Serializable, Comparable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4835205656099953572L;
	protected URI uri;
	protected URI fileURI;
	protected boolean processed = false;
	protected Set inputs = new HashSet();
	protected Set outputs = new HashSet();
	protected String name;	
	
	public ServiceItem() {
		
	}
	
	
	public ServiceItem(URI uri) {
		this.uri = uri; 
		this.name = uri.toString();
		this.fileURI = uri;
		ServiceContent content = ServiceLoader.getInstance().loadService(uri);
		this.uri = content.uri; 
		this.name = content.name;
		this.fileURI = content.fileURI;
		this.inputs = content.inputs;
		this.outputs = content.outputs;
	}
	
	
	public boolean isProcessed() {
		return processed;
	}
	
	public void setProcessed(boolean pro) {
		processed = pro;
	}
	
	public URI getURI(){
		return fileURI;
	}
	
	public String toString() {
		return getName();
	}
	
	public String getName() {
		String name = fileURI.toString();
		return name.substring(name.lastIndexOf("/")+1);
		//return name;
	}

	public int compareTo(Object obj) {
		if (!this.getClass().equals(obj.getClass()))
			return -1;
		return this.getName().compareTo(((ServiceItem) obj).getName());
	}	
	
	public Set getOutputs(){
		return outputs;
	}
	
	public Set getInputs(){
		return inputs;
	}
	
}

⌨️ 快捷键说明

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