Android Open Source - BART route Response






From Project

Back to project page BART.

License

The source code is released under:

GNU General Public License

If you think the Android project BART listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 *  Copyright (C) 2012  David Brodsky//from w w w  .ja v a 2 s . c o m
 *  This file is part of Open BART.
 *
 *  Open BART is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Open BART is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Open BART.  If not, see <http://www.gnu.org/licenses/>.
*/


package pro.dbro.bart;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;

public class routeResponse implements Serializable{
  public String originStation;
  public String destinationStation;
  public String specialSchedule;
  public Date date;
  public ArrayList<route> routes;
  
  public routeResponse(){
    routes = new ArrayList<route>(3);  // Typically three routes are returned. Let's save some trivial memory!
  }
  
  public route addRoute(){
    route newRoute = new route();
    routes.add(newRoute);
    return newRoute;
  }
  
  public route getLastRoute(){
    return (route) routes.get(routes.size()-1);
  }
  
  public route removeLastRoute(){
    route toRemove = (route) routes.get(routes.size()-1);
    routes.remove(routes.size()-1);
    return toRemove;
  }

    public void sortRoutes(){
        Collections.sort(routes);
    }
  
  public String toString(){
    return originStation + " to " + destinationStation + " on " + date.toString() + " routes: " + routes.toString();
  }

}




Java Source Code List

pro.dbro.bart.BART.java
pro.dbro.bart.BartLinearLayout.java
pro.dbro.bart.BartRouteParser.java
pro.dbro.bart.BartStationEtdParser.java
pro.dbro.bart.DeviceLocation.java
pro.dbro.bart.LocalPersistence.java
pro.dbro.bart.MapActivity.java
pro.dbro.bart.RequestTask.java
pro.dbro.bart.StationSuggestion.java
pro.dbro.bart.TextPlusIconArrayAdapter.java
pro.dbro.bart.TheActivity.java
pro.dbro.bart.UsherService.java
pro.dbro.bart.ViewCountDownTimer.java
pro.dbro.bart.etdResponse.java
pro.dbro.bart.etd.java
pro.dbro.bart.leg.java
pro.dbro.bart.routeResponse.java
pro.dbro.bart.route.java