Android Open Source - BART route

From Project

Back to project page BART.


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/*w  w w  .ja va2  s . c om*/
 *  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
 *  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 <>.

package pro.dbro.bart;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;

public class route implements Comparable<route>{
  public String fare;
  public Date departureDate;
  public Date arrivalDate;
  public ArrayList legs;
  public boolean bikes = false; // if all legs allow bikes, route flagged
  public boolean isExpanded = false; // is corresponding view expanded?
  public route(){
    legs = new ArrayList(3);  // Any point-point on BART should be navigable with 3 legs
  public leg addLeg(){
    leg newLeg = new leg();
    return newLeg;
  public leg getLastLeg(){
    return (leg)legs.get(legs.size()-1);
  public String toString(){
    if (legs.size() > 1){
      String response = departureDate.toString() + " : " + ((leg)legs.get(0)).trainHeadStation;
      for(int x=1; x < legs.size();x++){
        response += " to " + ((leg)legs.get(x)).trainHeadStation;
      return response;
      return departureDate.toString() + " : " + ((leg)legs.get(0)).trainHeadStation;

    public int compareTo(route another) {
        return departureDate.compareTo(another.departureDate);

Java Source Code List