Revision 963
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/installer/lib/api/Version.java | ||
---|---|---|
34 | 34 |
* @deprecated use #org.gvsig.tools.packageutils.Version |
35 | 35 |
* |
36 | 36 |
*/ |
37 |
public interface Version extends Cloneable { |
|
37 |
public interface Version extends Cloneable, Comparable {
|
|
38 | 38 |
|
39 | 39 |
public Version parse(String version); |
40 | 40 |
|
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/packageutils/impl/DefaultVersion.java | ||
---|---|---|
213 | 213 |
); |
214 | 214 |
} |
215 | 215 |
} |
216 |
|
|
217 |
public int compareTo(Object arg0) { |
|
218 |
Version other = (Version)arg0; |
|
219 |
return this.fullFormat().compareTo(other.fullFormat()); |
|
220 |
} |
|
216 | 221 |
|
217 | 222 |
public Object clone() throws CloneNotSupportedException { |
218 | 223 |
return super.clone(); |
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/packageutils/impl/DefaultPackageInfo.java | ||
---|---|---|
35 | 35 |
import java.text.MessageFormat; |
36 | 36 |
import java.util.ArrayList; |
37 | 37 |
import java.util.HashMap; |
38 |
import java.util.Iterator; |
|
38 | 39 |
import java.util.List; |
39 | 40 |
import java.util.Map; |
40 | 41 |
|
... | ... | |
127 | 128 |
return this.code; |
128 | 129 |
} |
129 | 130 |
|
131 |
private String getAliasAsString() { |
|
132 |
if( this.code == null ) { |
|
133 |
return ""; |
|
134 |
} |
|
135 |
StringBuffer s = new StringBuffer(); |
|
136 |
Iterator alias = this.code.getAlias().iterator(); |
|
137 |
while( alias.hasNext() ) { |
|
138 |
String ss = (String) alias.next(); |
|
139 |
s.append(ss); |
|
140 |
if( alias.hasNext() ) { |
|
141 |
s.append(", "); |
|
142 |
} |
|
143 |
} |
|
144 |
return s.toString(); |
|
145 |
} |
|
130 | 146 |
public boolean hasThisCode(String code) { |
131 | 147 |
if( this.code == null ) { |
132 | 148 |
if( code == null ) { |
... | ... | |
351 | 367 |
append(buffer, PackageInfoTags.DEPENDENCIES, getDependencies()); |
352 | 368 |
append(buffer, PackageInfoTags.WEB_URL, getWebURL()); |
353 | 369 |
append(buffer, PackageInfoTags.CATEGORIES, getCategories()); |
370 |
append(buffer, PackageInfoTags.CODEALIAS, getAliasAsString()); |
|
354 | 371 |
|
355 | 372 |
return buffer.append(')').toString(); |
356 | 373 |
} |
... | ... | |
373 | 390 |
// } |
374 | 391 |
|
375 | 392 |
public String toStringCompact() { |
376 |
// type code version state os arch jvm dep |
|
377 |
return strformat(this.type,-8,-4) + " " + |
|
378 |
strformat(this.code,-40,0) + " " + |
|
379 |
strformat(this.version,-20,-20) + " " + |
|
380 |
strformat(this.state,-5,-5) + " " + |
|
381 |
strformat(this.operatingSystem,-5,-5) + " " + |
|
382 |
strformat(this.architecture,-6,-6) + " " + |
|
383 |
strformat(this.javaVM,-5,-5) + " " + |
|
384 |
strformat(this.dependencies,-8,0); |
|
393 |
// type code version state os arch jvm dep alias |
|
394 |
StringBuffer s = new StringBuffer(); |
|
395 |
s.append(strformat(this.type,-8,-4)); |
|
396 |
s.append(" "); |
|
397 |
s.append(strformat(this.code,-40,0)); |
|
398 |
s.append(" "); |
|
399 |
s.append(strformat(this.version,-20,-20)); |
|
400 |
s.append(" "); |
|
401 |
s.append(strformat(this.state,-5,-5)); |
|
402 |
s.append(" "); |
|
403 |
s.append(strformat(this.operatingSystem,-5,-5)); |
|
404 |
s.append(" "); |
|
405 |
s.append(strformat(this.architecture,-6,-6)); |
|
406 |
s.append(" "); |
|
407 |
s.append(strformat(this.javaVM,-5,-5)); |
|
408 |
s.append(" "); |
|
409 |
s.append(strformat(this.dependencies,-8,0)); |
|
410 |
s.append(" "); |
|
411 |
s.append(strformat(this.getAliasAsString(),-8,0)); |
|
412 |
return s.toString(); |
|
385 | 413 |
} |
386 | 414 |
|
387 | 415 |
private static final String SPACES256 = " "; |
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/packageutils/Version.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
import org.gvsig.tools.lang.Cloneable; |
27 | 27 |
|
28 |
public interface Version extends Cloneable, org.gvsig.installer.lib.api.Version { |
|
28 |
public interface Version extends Cloneable, Comparable, org.gvsig.installer.lib.api.Version {
|
|
29 | 29 |
|
30 | 30 |
public org.gvsig.installer.lib.api.Version parse(String version); |
31 | 31 |
|
Also available in: Unified diff