Android Open Source - makler Alert Builder






From Project

Back to project page makler.

License

The source code is released under:

GNU General Public License

If you think the Android project makler 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 pl.net.newton.Makler.db.alert;
/*  www .  j  a v  a  2 s  . c o  m*/
import java.math.BigDecimal;

import android.database.Cursor;
import pl.net.newton.Makler.db.quote.Quote;
import pl.net.newton.Makler.db.quote.QuotesDao;
import pl.net.newton.Makler.gpw.ex.GpwException;

public class AlertBuilder {
  private int id;

  private Quote quote;

  private Subject subject;

  private Event event;

  private BigDecimal value;

  private boolean percent;

  private BigDecimal baseValue;

  private boolean used;

  public AlertBuilder setFromCursor(Cursor c, QuotesDao db) throws GpwException {
    this.id = c.getInt(c.getColumnIndex("id"));
    this.quote = db.getQuoteById(c.getInt(c.getColumnIndex("quote_id")));
    if (quote == null) {
      throw new GpwException("Nieznany walor");
    }
    this.subject = Subject.valueOf(c.getString(c.getColumnIndex("subject")));
    this.event = Event.valueOf(c.getString(c.getColumnIndex("event")));
    this.value = new BigDecimal(c.getString(c.getColumnIndex("value")));
    this.percent = c.getInt(c.getColumnIndex("percent")) == 1;
    this.baseValue = new BigDecimal(c.getString(c.getColumnIndex("base_value")));
    this.used = c.getInt(c.getColumnIndex("used")) == 1;
    return this;
  }

  public Alert build() {
    return new Alert(this);
  }

  int getId() {
    return id;
  }

  public AlertBuilder setId(Integer id) {
    this.id = id;
    return this;
  }

  Quote getQuote() {
    return quote;
  }

  public AlertBuilder setQuote(Quote quote) {
    this.quote = quote;
    return this;
  }

  Subject getSubject() {
    return subject;
  }

  public AlertBuilder setSubject(Subject subject) {
    this.subject = subject;
    return this;
  }

  Event getEvent() {
    return event;
  }

  public AlertBuilder setEvent(Event event) {
    this.event = event;
    return this;
  }

  BigDecimal getValue() {
    return value;
  }

  public AlertBuilder setValue(BigDecimal value) {
    this.value = value;
    return this;
  }

  boolean getPercent() {
    return percent;
  }

  public AlertBuilder setPercent(boolean percent) {
    this.percent = percent;
    return this;
  }

  BigDecimal getBaseValue() {
    return baseValue;
  }

  public AlertBuilder setBaseValue(BigDecimal baseValue) {
    this.baseValue = baseValue;
    return this;
  }

  boolean getUsed() {
    return used;
  }

  public AlertBuilder setUsed(boolean used) {
    this.used = used;
    return this;
  }

}




Java Source Code List

pl.net.newton.Makler.common.Configuration.java
pl.net.newton.Makler.common.DateFormatUtils.java
pl.net.newton.Makler.common.GpwUtils.java
pl.net.newton.Makler.common.LocaleUtils.java
pl.net.newton.Makler.common.NumberFormatUtils.java
pl.net.newton.Makler.db.Constants.java
pl.net.newton.Makler.db.DbHelper.java
pl.net.newton.Makler.db.SqlConnection.java
pl.net.newton.Makler.db.alert.AlertBuilder.java
pl.net.newton.Makler.db.alert.AlertChecker.java
pl.net.newton.Makler.db.alert.AlertValue.java
pl.net.newton.Makler.db.alert.Alert.java
pl.net.newton.Makler.db.alert.AlertsDao.java
pl.net.newton.Makler.db.alert.Event.java
pl.net.newton.Makler.db.alert.Subject.java
pl.net.newton.Makler.db.quote.QuoteField.java
pl.net.newton.Makler.db.quote.Quote.java
pl.net.newton.Makler.db.quote.QuotesDao.java
pl.net.newton.Makler.db.service.SqlProvider.java
pl.net.newton.Makler.db.symbol.SymbolBuilder.java
pl.net.newton.Makler.db.symbol.Symbol.java
pl.net.newton.Makler.db.symbol.SymbolsDb.java
pl.net.newton.Makler.db.wallet.WalletDb.java
pl.net.newton.Makler.db.wallet.WalletItemBuilder.java
pl.net.newton.Makler.db.wallet.WalletItem.java
pl.net.newton.Makler.gpw.DefaultQuotesReceiver.java
pl.net.newton.Makler.gpw.QuotesReceiver.java
pl.net.newton.Makler.gpw.ex.GpwException.java
pl.net.newton.Makler.gpw.service.QuotesListener.java
pl.net.newton.Makler.gpw.service.QuotesService.java
pl.net.newton.Makler.gpw.service.UpdatingThread.java
pl.net.newton.Makler.history.BossaProvider.java
pl.net.newton.Makler.history.ByteArrayUtils.java
pl.net.newton.Makler.history.Cache.java
pl.net.newton.Makler.history.ChannelTools.java
pl.net.newton.Makler.history.EntryListWithIndexes.java
pl.net.newton.Makler.history.EntryList.java
pl.net.newton.Makler.history.HistoryFilter.java
pl.net.newton.Makler.history.HistoryProvider.java
pl.net.newton.Makler.history.service.HistoryListener.java
pl.net.newton.Makler.history.service.HistoryService.java
pl.net.newton.Makler.httpClient.Connector.java
pl.net.newton.Makler.receivers.QuotesAlarmReceiver.java
pl.net.newton.Makler.receivers.StartupReceiver.java
pl.net.newton.Makler.service.ServiceManager.java
pl.net.newton.Makler.ui.About.java
pl.net.newton.Makler.ui.AbstractActivity.java
pl.net.newton.Makler.ui.Alerts.java
pl.net.newton.Makler.ui.FullScreenGraph.java
pl.net.newton.Makler.ui.Preferences.java
pl.net.newton.Makler.ui.QuoteDetails.java
pl.net.newton.Makler.ui.Quotes.java
pl.net.newton.Makler.ui.Symbols.java
pl.net.newton.Makler.ui.WalletForm.java
pl.net.newton.Makler.ui.WalletItemCalculator.java
pl.net.newton.Makler.ui.Wallet.java
pl.net.newton.Makler.ui.adapter.AlertsAdapter.java
pl.net.newton.Makler.ui.adapter.QuotesAdapter.java
pl.net.newton.Makler.ui.adapter.SymbolsAdapter.java
pl.net.newton.Makler.ui.adapter.WalletAdapter.java
pl.net.newton.Makler.ui.graph.GraphView.java
pl.net.newton.Makler.ui.graph.MaklerGraphicalView.java