Ignore:
Timestamp:
01/26/15 11:43:30 (10 years ago)
Author:
sherbold
Message:
  • updated experiment and SoftwareVersion? such that the order of the results will now always be the same and not depend on the order of the data loading. Instead, it depends on the string-order of the projects and versions that are loaded.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrossPare/src/de/ugoe/cs/cpdp/versions/SoftwareVersion.java

    r2 r27  
    77 * @author Steffen Herbold 
    88 */ 
    9 public class SoftwareVersion { 
     9public class SoftwareVersion implements Comparable<SoftwareVersion> { 
    1010 
    1111        /** 
     
    5959                return new Instances(instances); 
    6060        } 
     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        } 
    6178} 
Note: See TracChangeset for help on using the changeset viewer.