Android Open Source - dbpendler Station Mock Resource






From Project

Back to project page dbpendler.

License

The source code is released under:

Copyright 2013 Marcus Schiesser Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Softw...

If you think the Android project dbpendler 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

package de.marcusschiesser.dbpendler.client.services.resources.mocks;
// w  w  w.j  a v a 2 s. c o m
import java.util.HashMap;
import java.util.Map;

import de.marcusschiesser.dbpendler.common.resources.StationResource;
import de.marcusschiesser.dbpendler.common.vo.StationVO;

public class StationMockResource implements StationResource {

  static final String[] STATIONS = new String[] {

  "Aalen Bf", "Aulendorf Bf", "Baden-Baden Bf", "Biberach (Ri?) Bf",
      "Bruchsal Bf", "Crailsheim Bf", "Donaueschingen Bf",
      "Ellwangen Bf", "Freiburg (Breisgau) Hbf",
      "Friedrichshafen Stadt Bf", "Geislingen (Steige) Bf",
      "G?ppingen Bf", "Hausach Bf", "Heidelberg Hbf", "Horb Bf",
      "Hornberg Bf", "Karlsruhe Hbf", "Karlsruhe-Durlach", "Kehl Bf",
      "Konstanz Bf", "Mannheim Hbf", "Metzingen (W?rtt)", "M?hlacker Bf",
      "N?rtingen Bf", "Offenburg Bf", "Pforzheim Hbf", "Plochingen Bf",
      "Radolfzell Bf", "Ravensburg Bf", "Reutlingen Hbf", "Rottweil Bf",
      "Schorndorf Bf", "Schw?bisch Gm?nd Bf", "Singen (Hohentwiel) Bf",
      "Stuttgart Hbf", "Triberg Bf", "T?bingen Hbf", "Tuttlingen Bf",
      "Ulm Hbf", "Vaihingen (Enz) Bf", "Villingen Bf", "Weinheim Bf",
      "Wiesloch-Walldorf Bf", "Ansbach Bf", "Augsburg Hbf",
      "Berchtesgaden Hbf", "Buchloe Bf", "Donauw?rth Bf", "Fischen Bf",
      "Freilassing Bf", "F?rth (Bay) Hbf",
      "Steinach (b Rothenburg odT) Bf", "G?nzburg Bf", "Gunzenhausen Bf",
      "Immenstadt Bf", "Kaufbeuren Bf", "Kempten (Allg?u) Hbf",
      "Lindau Hbf", "Memmingen Bf", "M?nchen Hbf", "M?nchen Ostbf",
      "M?nchen-Pasing Bf", "Neumarkt (Oberpf) Bf", "N?rnberg Hbf",
      "Oberstdorf Bf", "Passau Hbf", "Plattling Bf", "Regensburg Hbf",
      "Rosenheim Bf", "Sonthofen Bf", "Traunstein Bf", "W?rzburg Hbf",
      "Angerm?nde Bf", "Berlin Hbf", "Berlin Ostbf",
      "Berlin Gesundbrunnen Bf", "Berlin-Spandau Bf",
      "Berlin S?dkreuz Bf", "Berlin-Wannsee Bf", "Bernau (b Berlin) Bf",
      "Brandenburg Hbf", "Cottbus Bf", "Eberswalde Hbf",
      "Elsterwerda Bf", "Forst (Lausitz) Bf", "Frankfurt (Oder) Bf",
      "L?bben (Spreewald) Bf", "L?bbenau (Spreewald) Bf", "Potsdam Hbf",
      "Prenzlau Bf", "Wittenberge Bf", "Bad Nauheim Bf", "Bebra Bf",
      "Bensheim Bf", "Darmstadt Hbf", "Dillenburg Bf",
      "Heppenheim (Bergstr) Bf", "Herborn Bf", "Frankfurt (Main) Hbf",
      "Frankfurt (Main) Flughafen Fernbf", "Frankfurt (Main) S?d",
      "Friedberg (Hess) Bf", "Fulda Bf", "Gie?en Bf", "Hanau Hbf",
      "Kassel-Wilhelmsh?he Bf", "Marburg (Lahn) Bf", "Treysa Bf",
      "Wabern Bf", "Wetzlar Bf", "Wiesbaden Hbf" };
  
  private Map<String, StationVO> result = null;
  
  private Map<String, StationVO> getStations() {
    if(result==null) {
      result = new HashMap<String, StationVO>(STATIONS.length);
      for (int i = 0; i < STATIONS.length; i++) {
        String stationName = STATIONS[i];
        StationVO station = new StationVO(stationName);
        result.put(stationName, station);
      }
    }
    return result;
  }

  public StationVO[] getList(String startsWith) {
    return getStations().values().toArray(new StationVO[STATIONS.length]);
  }

  public StationVO get(String id) {
    return getStations().get(id);
  }
}




Java Source Code List

de.marcusschiesser.dbpendler.client.Confirmation.java
de.marcusschiesser.dbpendler.client.DBPendler.java
de.marcusschiesser.dbpendler.client.EditConnection.java
de.marcusschiesser.dbpendler.client.Preferences.java
de.marcusschiesser.dbpendler.client.adapters.ConnectionOverviewAdapter.java
de.marcusschiesser.dbpendler.client.adapters.EditConnectionAdapter.java
de.marcusschiesser.dbpendler.client.adapters.StationAdapter.java
de.marcusschiesser.dbpendler.client.model.ConnectionsDb.java
de.marcusschiesser.dbpendler.client.services.ConnectionService.java
de.marcusschiesser.dbpendler.client.services.resources.AbstractClientResource.java
de.marcusschiesser.dbpendler.client.services.resources.ConnectionClientResource.java
de.marcusschiesser.dbpendler.client.services.resources.mocks.ConnectionMockResource.java
de.marcusschiesser.dbpendler.client.services.resources.mocks.StationMockResource.java
de.marcusschiesser.dbpendler.common.resources.BookingResource.java
de.marcusschiesser.dbpendler.common.resources.ConnectionResource.java
de.marcusschiesser.dbpendler.common.resources.StationResource.java
de.marcusschiesser.dbpendler.common.vo.CommitVO.java
de.marcusschiesser.dbpendler.common.vo.ConnectionVO.java
de.marcusschiesser.dbpendler.common.vo.StationVO.java