Back to project page Bussan.
The source code is released under:
Copyright 2011 Kristian Bendiksen. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ...
If you think the Android project Bussan listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package no.kriben.bussan; //w ww. ja va 2 s.c o m import android.content.Context; import no.kriben.busstopstrondheim.model.BusStop; public class BusStopNameFormatter { public static String format(Context context, BusStop busStop) { // Try to construct a direction string: // buses with id smaller than 1000 are going to town // less than equal 1000 is leaving town // larger than 2000 is unknown String direction = ""; int id = Integer.valueOf(busStop.getId()); if (id < 2000) { if (id < 1000) direction = " (" + context.getString(R.string.from_town) + ")"; else direction = " (" + context.getString(R.string.to_town) + ")"; } return busStop.getName() + direction; } }