Changeset 57 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder


Ignore:
Timestamp:
08/14/2017 02:46:52 PM (9 years ago)
Author:
bmcguffin
Message:

Added test cases for TimeSlice? class. Added a reference file containing a single timeslice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/structures/TimeSlice.java

    r48 r57  
    181181    public int compareTo(Object o) 
    182182    { 
    183         TimeSlice other = (TimeSlice) o; 
    184         if (this.getTime() < other.getTime()) 
    185         { 
    186             return -1; 
    187         } 
    188         else if (this.getTime() > other.getTime()) 
    189         { 
    190             return 1; 
    191         } 
    192         else 
    193         { 
    194             return 0; 
    195         } 
     183        if (o instanceof TimeSlice) 
     184        { 
     185            TimeSlice other = (TimeSlice) o; 
     186            if (this.getTime() < other.getTime()) 
     187            { 
     188                return -1; 
     189            } 
     190            else if (this.getTime() > other.getTime()) 
     191            { 
     192                return 1; 
     193            } 
     194        } 
     195        return 0; 
    196196    } 
    197197 
Note: See TracChangeset for help on using the changeset viewer.