String uri, s_uri, result_count;
String write;
int counter = 1;
int rqueries = 1;
Iterator answerSet;
HybridServiceItem item;
Set ioset;
for(Iterator iter = result.keySet().iterator();iter.hasNext();){
query = (Query) iter.next();
uri = query.getURI().toString();
if (uri.contains("/"))
uri = uri.substring(uri.lastIndexOf("/")+1);
write = "Query " + rqueries + " " + uri;
//write = write.replaceAll("[\\r\\f]","");
System.out.println(write);
System.out.println("Inputs:");
ioset = query.getInputs();
for(Object input : ioset){
System.out.println(" " + input.toString());
}
System.out.println("Outputs:");
ioset = query.getOutputs();
for(Object input : ioset){
System.out.println(" " + input.toString());
}
for (answerSet = ((SortedSet) result.get(query)).iterator();answerSet.hasNext();) {
item = (HybridServiceItem) answerSet.next() ;
s_uri = item.getURI().toString();
if (s_uri.contains("/"))
s_uri = s_uri.substring(s_uri.lastIndexOf("/")+1);
if (counter<10)
result_count = "0" + counter;
else
result_count = "" + counter;
write = result_count + " (" + item.getDegreeOfMatch() + "," + item.getSyntacticSimilarity() + ") " + s_uri + "\n";
//write = write.replaceAll("[\\r\\f]","");
if ( max_SynSim < item.getSyntacticSimilarity()){
max_SynSim = item.getSyntacticSimilarity();
}
if ( min_SynSim > item.getSyntacticSimilarity()){
min_SynSim = item.getSyntacticSimilarity();
}
System.out.println(write);
counter++;
System.out.println("Inputs:");
ioset = item.getInputs();
for(Object input : ioset){
System.out.println(" " + input.toString());
}
System.out.println("Outputs:");
ioset = item.getOutputs();
for(Object input : ioset){
System.out.println(" " + input.toString());
}
}
counter =1;