From a03ba9a8838ba60e7ad4b382bc001dd2476f40df Mon Sep 17 00:00:00 2001 From: Seth Ladygo Date: Wed, 20 Jun 2018 22:31:06 -0700 Subject: [PATCH] more tabs to spaces --- src/main/java/OANDATickEvent.java | 118 +++++++++++++++--------------- src/main/java/TickEvent.java | 66 ++++++++--------- 2 files changed, 92 insertions(+), 92 deletions(-) diff --git a/src/main/java/OANDATickEvent.java b/src/main/java/OANDATickEvent.java index 90b1ab2..4e962d5 100644 --- a/src/main/java/OANDATickEvent.java +++ b/src/main/java/OANDATickEvent.java @@ -9,72 +9,72 @@ import com.fasterxml.jackson.annotation.JsonFormat; * {"type":"PRICE","time":"2018-04-05T20:35:20.983907480Z","bids":[{"price":"1.22376","liquidity":10000000}],"asks":[{"price":"1.22386","liquidity":10000000}],"closeoutBid":"1.22361","closeoutAsk":"1.22401","status":"tradeable","tradeable":true,"instrument":"EUR_USD"} */ public class OANDATickEvent extends TickEvent { - public String type; - private DateTime time; - public PriceBucket[] bids; - public PriceBucket[] asks; - public BigDecimal closeoutBid; - public BigDecimal closeoutAsk; - public String status; - public boolean tradeable; - private String instrument; + public String type; + private DateTime time; + public PriceBucket[] bids; + public PriceBucket[] asks; + public BigDecimal closeoutBid; + public BigDecimal closeoutAsk; + public String status; + public boolean tradeable; + private String instrument; - /** - * @return the instrument - */ - @Override - public String getInstrument() { - return instrument; - } + /** + * @return the instrument + */ + @Override + public String getInstrument() { + return instrument; + } - /** - * @param instrument the instrument to set - */ - public void setInstrument(String instrument) { - this.instrument = instrument; - } + /** + * @param instrument the instrument to set + */ + public void setInstrument(String instrument) { + this.instrument = instrument; + } - /** - * @return the time - */ - @Override - public DateTime getTime() { - return time; - } + /** + * @return the time + */ + @Override + public DateTime getTime() { + return time; + } - /** - * @param time the time to set - */ - public void setTime(DateTime time) { - this.time = time; - } + /** + * @param time the time to set + */ + public void setTime(DateTime time) { + this.time = time; + } - /** - * @return the bid - */ - @Override - public BigDecimal getBid() { - return bids[0].price; - } + /** + * @return the bid + */ + @Override + public BigDecimal getBid() { + return bids[0].price; + } - /** - * @return the ask - */ - @Override - public BigDecimal getAsk() { - return asks[0].price; - } + /** + * @return the ask + */ + @Override + public BigDecimal getAsk() { + return asks[0].price; + } - /** - * @return the midprice between bid and ask - */ - @Override - public BigDecimal getMid() { - return getMid(asks[0].price, bids[0].price); - } + /** + * @return the midprice between bid and ask + */ + @Override + public BigDecimal getMid() { + return getMid(asks[0].price, bids[0].price); + } - public String toString() { - return String.format("OANDATickEvent[%s,%s,%s]", getTime(), getInstrument(), getMid()); - } + public String toString() { + return String.format("OANDATickEvent[%s, %s, %s]", getTime(), getInstrument(), getMid()); + } } diff --git a/src/main/java/TickEvent.java b/src/main/java/TickEvent.java index a939820..60fbde0 100644 --- a/src/main/java/TickEvent.java +++ b/src/main/java/TickEvent.java @@ -4,43 +4,43 @@ import org.joda.time.DateTime; public abstract class TickEvent { - /** - * @return the tick time - */ - public abstract DateTime getTime(); + /** + * @return the tick time + */ + public abstract DateTime getTime(); - /** - * @return the trading instrument - */ - public abstract String getInstrument(); + /** + * @return the trading instrument + */ + public abstract String getInstrument(); - /** - * @return the bid price - */ - public abstract BigDecimal getBid(); + /** + * @return the bid price + */ + public abstract BigDecimal getBid(); - /** - * @return the ask price - */ - public abstract BigDecimal getAsk(); + /** + * @return the ask price + */ + public abstract BigDecimal getAsk(); - /** - * @return the midprice between bid and ask - */ - public abstract BigDecimal getMid(); + /** + * @return the midprice between bid and ask + */ + public abstract BigDecimal getMid(); - /** - * Calculate the midpoint between two values. - */ - public static BigDecimal getMid(BigDecimal a, BigDecimal b) { - BigDecimal diff = a.subtract(b).abs(); - return a.min(b).add(diff.divide(new BigDecimal(2))); - } + /** + * Calculate the midpoint between two values. + */ + public static BigDecimal getMid(BigDecimal a, BigDecimal b) { + BigDecimal diff = a.subtract(b).abs(); + return a.min(b).add(diff.divide(new BigDecimal(2))); + } - /** - * Calculate the midpoint between two values. - */ - public double getMidDouble() { - return getMid().doubleValue(); - } + /** + * Calculate the midpoint between two values. + */ + public double getMidDouble() { + return getMid().doubleValue(); + } }