Android Open Source - Realtime-Port-Authority Route






From Project

Back to project page Realtime-Port-Authority.

License

The source code is released under:

Apache License

If you think the Android project Realtime-Port-Authority 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 rectangledbmi.com.pittsburghrealtimetracker.world;
/*  w w w  . java 2 s . co m*/
import android.graphics.Color;

/**
 * Created by epicstar on 9/5/14.
 */
public class Route {

    /**
     * This is the route number
     */
    private String route;

    /**
     * This is the route's general 3 word summary
     */
    private String routeInfo;

    /**
     * This is the color of the route as an int
     */
    private int routeColor;

    /**
     * Null constructor of the route
     */
    public Route() {
        this(null, null, null);
    }

    public Route(String route) {
        this(route, null, null);
    }

    /**
     * The non-null constructor of the route and color as a string or hex-string
     * @param route the route number
     * @param routeInfo the route info
     * @param routeColor the color of the route as a string or string-hex
     */
    public Route(String route, String routeInfo, String routeColor) {
        this(route, routeInfo, Color.parseColor(routeColor));
    }

    /**
     * The main route constructor
     * @param route the route number
     * @param routeInfo the route info
     * @param routeColor the color of the route as an int
     */
    public Route(String route, String routeInfo, int routeColor) {
        this.route = route;
        this.routeInfo = routeInfo;
        this.routeColor = routeColor;
    }

    /**
     *
     * @return the route number
     */
    public String getRoute() {
        return route;
    }

    /**
     * Set the route number
     * @param route the route number to be set
     */
    public void setRoute(String route) {
        this.route = route;
    }

    /**
     * @return the route info
     */
    public String getRouteInfo() {
        return routeInfo;
    }

    /**
     * Sets the route info
     * @param routeInfo the route info
     */
    public void setRouteInfo(String routeInfo) {
        this.routeInfo = routeInfo;
    }

    /**
     *
     * @return the route color as an int
     */
    public int getRouteColor() {
        return routeColor;
    }

    /**
     * set the route color as an int
     * @param routeColor the route color as an int
     */
    public void setRouteColor(int routeColor) {
        this.routeColor = routeColor;
    }

    /**
     * set the route color if a String is fed
     * @param routeColor the route color as a String
     */
    public void setRouteColor(String routeColor) {
        setRouteColor(Color.parseColor(routeColor));
    }

    /**
     * Gets the int color as a hex string from:
     * http://stackoverflow.com/questions/4506708/android-convert-color-int-to-hexa-string
     *
     * @return color as hex-string
     */
    public String getColorAsString() {
        return String.format("#%06X", 0xFFFFFF & routeColor);
    }

    /**
     * Auto-Generated by Android Studio
     * @return String of Route
     */
    @Override
    public String toString() {
        return route + " - " + routeInfo + "\ncolor: " + routeColor + " - " + getColorAsString();
    }
}




Java Source Code List

.Globals.java
.PortAuthorityRealtime.java
rectangledbmi.com.pittsburghrealtimetracker.AboutActivity.java
rectangledbmi.com.pittsburghrealtimetracker.ApplicationTest.java
rectangledbmi.com.pittsburghrealtimetracker.BusInformationDialog.java
rectangledbmi.com.pittsburghrealtimetracker.NavigationDrawerFragment.java
rectangledbmi.com.pittsburghrealtimetracker.SelectTransit.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.BusNotRunningException.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.BusSaxHandler.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.BusXMLPullParser.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.InputSave.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.PredictionsXMLPullParser.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.RequestLine.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.RequestPredictions.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.RequestRoutes.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.RequestTask.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.RouteSaxHandler.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.TransitSAXHandler.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.containers.ETAContainer.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.containers.RequestLineContainer.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.extend.CheckableRelativeLayout.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.extend.ColoredArrayAdapter.java
rectangledbmi.com.pittsburghrealtimetracker.handlers.extend.ETAWindowAdapter.java
rectangledbmi.com.pittsburghrealtimetracker.world.Bus.java
rectangledbmi.com.pittsburghrealtimetracker.world.LineInfo.java
rectangledbmi.com.pittsburghrealtimetracker.world.Prediction.java
rectangledbmi.com.pittsburghrealtimetracker.world.Route.java
rectangledbmi.com.pittsburghrealtimetracker.world.TransitStop.java