Changeset 204 in tmcsimulator for trunk/src/atmsdriver/model


Ignore:
Timestamp:
10/31/2017 02:08:33 PM (9 years ago)
Author:
jdalbey
Message:

TrafficModelManager?.java Refactor for code sharing with TrafficModelEventDriver?. Write unit test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/atmsdriver/model/TrafficEvent.java

    r197 r204  
    66import java.util.Date; 
    77import java.util.Scanner; 
     8 
    89 
    910/** 
     
    2728    public final double range; 
    2829    public final String rawString; 
     30     
    2931    private final static SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss"); 
    3032 
     
    6163        return rawString; 
    6264    } 
     65    @Override  
     66    public boolean equals(Object other) 
     67    { 
     68        Boolean result = false; 
     69        if (other == null) return false; 
     70        if ( other instanceof TrafficEvent  ) 
     71        { 
     72          TrafficEvent that = (TrafficEvent) other; 
     73          result = that.incident.equals(this.incident) 
     74                  && that.eventTime.equals(this.eventTime) 
     75                  && ((int) that.postmile) == ((int) this.postmile) 
     76                  && that.dir == this.dir 
     77                  && that.color == this.color; 
     78        } 
     79        return result;     
     80    }             
    6381} 
Note: See TracChangeset for help on using the changeset viewer.