- Timestamp:
- 01/26/15 11:43:30 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CrossPare/src/de/ugoe/cs/cpdp/versions/SoftwareVersion.java
r2 r27 7 7 * @author Steffen Herbold 8 8 */ 9 public class SoftwareVersion {9 public class SoftwareVersion implements Comparable<SoftwareVersion> { 10 10 11 11 /** … … 59 59 return new Instances(instances); 60 60 } 61 62 /** 63 * Compares first based on project name and then based on version. Only string comparisons are performed. 64 * @see java.lang.Comparable#compareTo(java.lang.Object) 65 */ 66 @Override 67 public int compareTo(SoftwareVersion o) { 68 int projectStrCmp = 0; 69 if( project!=null ) { 70 projectStrCmp = project.compareTo(o.project); 71 } 72 if( projectStrCmp==0 && version!=null ) { 73 return version.compareTo(o.version); 74 } else { 75 return projectStrCmp; 76 } 77 } 61 78 }
Note: See TracChangeset
for help on using the changeset viewer.