1 6 package cve.esecutori.components.specificaSem; 7 8 import java.util.*; 9 10 import cve.staticLayout.*; 11 12 import org.apache.log4j.Logger; 13 14 19 public class Association { 20 21 private String idSentence; 22 private String idAss; 23 private String idSem; 24 25 private HashMap resource; 28 29 public Association(){ 30 Cve.errLog.debug(""); 31 resource = new HashMap(); 32 } 33 34 public void setIdSentence(String idSent){ 35 Cve.errLog.debug(""); 36 this.idSentence = idSent; 37 } 38 39 public String getIdSentence(){ 40 Cve.errLog.debug(""); 41 return this.idSentence; 42 } 43 44 public void setIdAss(String id){ 45 Cve.errLog.debug(""); 46 this.idAss = id; 47 } 48 49 public String getIdAss(){ 50 Cve.errLog.debug(""); 51 return this.idAss; 52 } 53 54 55 public void setIdSem(String id){ 56 Cve.errLog.debug(""); 57 this.idSem = id; 58 } 59 60 public String getIdSem(){ 61 Cve.errLog.debug(""); 62 return this.idSem; 63 } 64 65 public void putResource(String res, Vector parameter){ 66 this.resource.put(res, parameter); 67 Cve.errLog.debug(""); 68 } 69 70 public HashMap getResource(){ 71 Cve.errLog.debug(""); 72 return this.resource; 73 } 74 75 public void setParameter(String parameter, String value){ 77 78 String appo_res; 80 Vector appo_par; 81 82 Cve.errLog.debug(""); 85 Set setResource = resource.keySet(); 87 Iterator resIt = setResource.iterator(); 88 while (resIt.hasNext()){ 89 appo_res = (String )resIt.next(); 91 appo_par = (Vector)resource.get(appo_res); 93 int i=0; 95 boolean trovato = false; 96 while (i < appo_par.size()-1){ 97 if (appo_par.get(i).equals(parameter)){ 98 i = i+1; 100 appo_par.set(i,value); 101 trovato=true; 102 } 103 if (trovato){ 105 i = i+1; 106 trovato = false; 107 }else{ 108 i = i+2; 109 } 110 } resource.remove(appo_res); 114 putResource(appo_res,appo_par); 116 } 118 } 119 120 121 122 } | Popular Tags |