source: proiecte/ptvs/src/vnsim/vehicular/scenarios/Route.java @ 31

Last change on this file since 31 was 31, checked in by (none), 14 years ago
File size: 1.1 KB
Line 
1/************************************************************************************
2 * Copyright (C) 2008 by Politehnica University of Bucharest and Rutgers University
3 * All rights reserved.
4 * Refer to LICENSE for terms and conditions of use.
5 ***********************************************************************************/
6package vnsim.vehicular.scenarios;
7
8
9import java.util.ArrayList;
10
11import vnsim.vehicular.simulator.Location;
12import vnsim.vehicular.simulator.RouteSegment;
13
14
15public class Route implements java.io.Serializable {
16       
17        /** <code>serialVersionUID</code> */
18        private static final long serialVersionUID = -5883719321862303634L;
19       
20        public Location entry;
21        public Location exit;
22        public ArrayList<RouteSegment> route;
23       
24        public boolean equals(Route r) {
25                if(entry.equals(r.entry) && exit.equals(r.exit)) {
26                        if(route.size()==r.route.size()){
27                                for(int i=0;i<route.size();i++){
28                                if(!route.get(i).equals(r.route.get(i))) {
29                                        return false;
30                                }
31                        }
32                        return true;
33                        } else {
34                                return false;
35                        }
36                }else{
37                        return false;
38                }
39        }
40}
Note: See TracBrowser for help on using the repository browser.