package am.va.graph;

import java.util.HashMap;

import am.app.ontology.Node;

/**
 * Possible alignment pairs, 1 to n
 * @author Yiting
 *
 */
public class VAUFLPairs {
	private Node sourceNode;
	private HashMap<String, Node> targetNodes; //target name & target node
	private String bestChoice;
	private double sim;
	
	
	public VAUFLPairs(Node sourceNode) {
		super();
		this.sourceNode = sourceNode;
		this.targetNodes = new HashMap<String, Node>();
		this.bestChoice = "";
		sim = 0;
	}
	
	public Node getSourceNode() {
		return sourceNode;
	}
	public void setSourceNode(Node sourceNode) {
		this.sourceNode = sourceNode;
	}
	
	public HashMap<String, Node> getTargetNodes() {
		return targetNodes;
	}

	public void setTargetNodes(HashMap<String, Node> targetNodes) {
		this.targetNodes = targetNodes;
	}

	public void addToTargetList(Node n){
		targetNodes.put(n.getLocalName(), n);
	}
	
	public void setBestChoice(String c){
		this.bestChoice = c;
	}
	
	public boolean selected(){
		return !bestChoice.equals("");
	}
	
	public String getBestChoice(){
		return bestChoice;
	}
	
	public void setSim(double sim){
		this.sim = sim;
	}
	
	public String getSim(){
		return String.valueOf(sim);
	}
	
	/**
	 * Check if target node is already in the hash map
	 * @param target
	 * @return
	 */
	public boolean containTarget(String target){
		if(targetNodes.containsKey(target))
			return true;
		return false;
	}
	
	
}

@@ -112,16 +112,20 @@
  1 to n%0A
+ * %0A
  * @auth
@@ -136,16 +136,17 @@
 iting%0A *
+ 
 %0A */%0Apub
@@ -240,16 +240,17 @@
 odes; //
+ 
 target n
@@ -316,19 +316,16 @@
 le sim;%0A
-%09%0A%09
 %0A%09public
@@ -482,25 +482,24 @@
 sim = 0;%0A%09%7D%0A
-%09
 %0A%09public Nod
@@ -542,16 +542,17 @@
 ode;%0A%09%7D%0A
+%0A
 %09public 
@@ -620,25 +620,24 @@
 rceNode;%0A%09%7D%0A
-%09
 %0A%09public Has
@@ -839,17 +839,35 @@
 (Node n)
-%7B
+ %7B // set name here
 %0A%09%09targe
@@ -893,16 +893,37 @@
 alName()
+ + %22%7C%22 + n.getLabel()
 , n);%0A%09%7D
@@ -919,25 +919,24 @@
 l(), n);%0A%09%7D%0A
-%09
 %0A%09public voi
@@ -960,16 +960,17 @@
 tring c)
+ 
 %7B%0A%09%09this
@@ -985,25 +985,24 @@
 ice = c;%0A%09%7D%0A
-%09
 %0A%09public boo
@@ -1016,16 +1016,17 @@
 lected()
+ 
 %7B%0A%09%09retu
@@ -1051,25 +1051,24 @@
 als(%22%22);%0A%09%7D%0A
-%09
 %0A%09public Str
@@ -1086,16 +1086,17 @@
 Choice()
+ 
 %7B%0A%09%09retu
@@ -1109,25 +1109,24 @@
 tChoice;%0A%09%7D%0A
-%09
 %0A%09public voi
@@ -1145,16 +1145,17 @@
 ble sim)
+ 
 %7B%0A%09%09this
@@ -1169,17 +1169,16 @@
 sim;%0A%09%7D%0A
-%09
 %0A%09public
@@ -1193,16 +1193,17 @@
 getSim()
+ 
 %7B%0A%09%09retu
@@ -1229,17 +1229,16 @@
 im);%0A%09%7D%0A
-%09
 %0A%09/**%0A%09 
@@ -1287,16 +1287,21 @@
 ash map%0A
+%09 * %0A
 %09 * @par
@@ -1375,14 +1375,16 @@
 get)
+ 
 %7B%0A%09%09if
+ 
 (tar
@@ -1452,10 +1452,7 @@
 %0A%09%7D%0A
-%09%0A%09
 %0A%7D%0A

add label for questions