- 更新日時:
- 2016/05/27 10:57:22 (8 年 前)
- ファイル:
-
- 1 変更
凡例:
- 変更なし
- 追加
- 削除
-
SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/OWL/Path.java
r259 r281 20 20 */ 21 21 private String startClass; 22 private int width; 22 //private int width; 23 private float width; 24 private int min; 25 private boolean chk; 23 26 24 27 /** … … 111 114 } 112 115 json_str += ","; 113 json_str +="\"score\":\""+width+"\""; 116 //json_str +="\"score\":\""+width+"\""; 117 json_str +="\"score\":\""+""+"\""; 114 118 json_str +="}"; 115 119 … … 132 136 } 133 137 134 public int getWidth() {138 public float getWidth() { 135 139 return width; 136 140 } … … 157 161 } 158 162 163 public void setWidth(double width) { 164 this.width = (float) width; 165 } 166 167 public void setMin(int min){ 168 this.min = min; 169 } 170 171 public int getMin(){ 172 return min; 173 } 174 175 public void setChk(boolean chk){ 176 this.chk = chk; 177 } 178 179 public boolean getChk(){ 180 return chk; 181 } 182 159 183 @Override 160 184 public int compareTo(Path path) { 161 return this.width - path.getWidth() ; 185 if ( this.width - path.getWidth() > 0 ){ return 1; } 186 else if ( this.width - path.getWidth() < 0 ){ return -1; } 187 else { 188 if ( this.chk == true && path.getChk() == false ){ return 1; } 189 if ( this.chk == false && path.getChk() == true ){ return -1; } 190 else { 191 if ( path.classLinks.size() - this.classLinks.size() > 0 ){ return 1;} 192 else if ( path.classLinks.size() - this.classLinks.size() < 0 ){ return -1;} 193 else{ 194 if ( this.min - path.getMin() > 0 ){ return 1; } 195 else if ( this.min - path.getMin() < 0 ){ return -1;} 196 return 0; 197 } 198 } 199 } 200 //return this.width - path.getWidth() ; 162 201 //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 163 202 }