Android Open Source - StockTicker Quote






From Project

Back to project page StockTicker.

License

The source code is released under:

MIT License

If you think the Android project StockTicker 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 com.github.premnirmal.ticker.network.historicaldata;
/*  w  w w  .j a  v  a 2s .  c  o  m*/
import android.os.Parcel;
import android.os.Parcelable;

import com.github.premnirmal.ticker.network.QueryCreator;
import com.google.gson.annotations.SerializedName;

import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormatter;


public class Quote implements Parcelable, Comparable<Quote> {

    public static final DateTimeFormatter formatter = QueryCreator.formatter;

    public static final String FIELD_HIGH = "High";
    public static final String FIELD_OPEN = "Open";
    public static final String FIELD_SYMBOL = "Symbol";
    public static final String FIELD_ADJ_CLOSE = "Adj_Close";
    public static final String FIELD_CLOSE = "Close";
    public static final String FIELD_VOLUME = "Volume";
    public static final String FIELD_DATE = "Date";
    public static final String FIELD_LOW = "Low";


    @SerializedName(FIELD_HIGH)
    public double mHigh;
    @SerializedName(FIELD_OPEN)
    public double mOpen;
    @SerializedName(FIELD_SYMBOL)
    public String mSymbol;
    @SerializedName(FIELD_ADJ_CLOSE)
    public double mAdjClose;
    @SerializedName(FIELD_CLOSE)
    public double mClose;
    @SerializedName(FIELD_VOLUME)
    public int mVolume;
    @SerializedName(FIELD_DATE)
    public String mDate;
    @SerializedName(FIELD_LOW)
    public double mLow;


    public Quote(){

    }

    public DateTime getDate() {
        return formatter.parseDateTime(mDate);
    }

    public Quote(Parcel in) {
        mHigh = in.readDouble();
        mOpen = in.readDouble();
        mSymbol = in.readString();
        mAdjClose = in.readDouble();
        mClose = in.readDouble();
        mVolume = in.readInt();
        mDate = in.readString();
        mLow = in.readDouble();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Parcelable.Creator<Quote> CREATOR = new Parcelable.Creator<Quote>() {
        public Quote createFromParcel(Parcel in) {
            return new Quote(in);
        }

        public Quote[] newArray(int size) {
            return new Quote[size];
        }
    };

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeDouble(mHigh);
        dest.writeDouble(mOpen);
        dest.writeString(mSymbol);
        dest.writeDouble(mAdjClose);
        dest.writeDouble(mClose);
        dest.writeInt(mVolume);
        dest.writeString(mDate);
        dest.writeDouble(mLow);
    }

    @Override
    public int compareTo(Quote another) {
        return mDate.compareTo(another.mDate);
    }
}




Java Source Code List

com.github.premnirmal.ticker.AppModule.java
com.github.premnirmal.ticker.ApplicationTest.java
com.github.premnirmal.ticker.BaseActivity.java
com.github.premnirmal.ticker.StocksApp.java
com.github.premnirmal.ticker.Tools.java
com.github.premnirmal.ticker.UpdateReceiver.java
com.github.premnirmal.ticker.events.NoNetworkEvent.java
com.github.premnirmal.ticker.events.StockUpdatedEvent.java
com.github.premnirmal.ticker.model.HistoryProvider.java
com.github.premnirmal.ticker.model.IHistoryProvider.java
com.github.premnirmal.ticker.model.IStocksProvider.java
com.github.premnirmal.ticker.model.StocksProvider.java
com.github.premnirmal.ticker.model.StocksStorage.java
com.github.premnirmal.ticker.network.ApiModule.java
com.github.premnirmal.ticker.network.QueryCreator.java
com.github.premnirmal.ticker.network.QueryResults.java
com.github.premnirmal.ticker.network.Query.java
com.github.premnirmal.ticker.network.Results.java
com.github.premnirmal.ticker.network.StockQuery.java
com.github.premnirmal.ticker.network.Stock.java
com.github.premnirmal.ticker.network.StocksApi.java
com.github.premnirmal.ticker.network.StupidYahooWrapConverter.java
com.github.premnirmal.ticker.network.SuggestionApi.java
com.github.premnirmal.ticker.network.Suggestion.java
com.github.premnirmal.ticker.network.Suggestions.java
com.github.premnirmal.ticker.network.historicaldata.HistoricalData.java
com.github.premnirmal.ticker.network.historicaldata.History.java
com.github.premnirmal.ticker.network.historicaldata.Query.java
com.github.premnirmal.ticker.network.historicaldata.Quote.java
com.github.premnirmal.ticker.settings.FileExportTask.java
com.github.premnirmal.ticker.settings.FileImportTask.java
com.github.premnirmal.ticker.settings.SettingsActivity.java
com.github.premnirmal.ticker.ui.GraphActivity.java
com.github.premnirmal.ticker.ui.ParanormalActivity.java
com.github.premnirmal.ticker.ui.StocksAdapter.java
com.github.premnirmal.ticker.ui.SuggestionsAdapter.java
com.github.premnirmal.ticker.ui.TickerSelectorActivity.java
com.github.premnirmal.ticker.widget.RemoteStockProviderService.java
com.github.premnirmal.ticker.widget.RemoteStockViewAdapter.java
com.github.premnirmal.ticker.widget.StockWidget.java
com.terlici.dragndroplist.DragNDropAdapter.java
com.terlici.dragndroplist.DragNDropCursorAdapter.java
com.terlici.dragndroplist.DragNDropListView.java
com.terlici.dragndroplist.DragNDropSimpleAdapter.java