|
From: Márcio V. d. S. <mv...@us...> - 2007-05-17 23:07:00
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv3463/src/java/net/sf/tail Modified Files: Tick.java Indicator.java TimeSeries.java Log Message: Refatoração de código Index: Indicator.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/Indicator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Indicator.java 12 May 2007 14:23:35 -0000 1.2 --- Indicator.java 17 May 2007 23:06:56 -0000 1.3 *************** *** 2,5 **** public interface Indicator<T> { ! public T getValue(int index); } --- 2,5 ---- public interface Indicator<T> { ! public T getValue(int index); } Index: Tick.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/Tick.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Tick.java 17 May 2007 21:30:54 -0000 1.7 --- Tick.java 17 May 2007 23:06:56 -0000 1.8 *************** *** 6,17 **** --- 6,26 ---- private Timestamp data; + private double openPrice; + private double closePrice; + private double maxPrice; + private double minPrice; + private double variation; + private double previousPrice; + private double amount; + private double volume; + private int trades; *************** *** 22,49 **** public Tick(Timestamp data, double openPrice, double closePrice, double maxPrice, double minPrice, ! double variation,double previousPrice,double amount,double volume,int trades) { ! super(); this.data = data; this.openPrice = openPrice; this.closePrice = closePrice; ! this.maxPrice = maxPrice; ! this.minPrice = minPrice; ! this.variation = variation; ! this.previousPrice = previousPrice; ! this.amount = amount; this.volume = volume; this.trades = trades; } ! public Tick(double openPrice, double closePrice, double maxPrice, double minPrice) ! { ! super(); this.openPrice = openPrice; this.closePrice = closePrice; ! this.maxPrice = maxPrice; ! this.minPrice = minPrice; } - public double getClosePrice() { return closePrice; --- 31,56 ---- public Tick(Timestamp data, double openPrice, double closePrice, double maxPrice, double minPrice, ! double variation, double previousPrice, double amount, double volume, int trades) { ! super(); this.data = data; this.openPrice = openPrice; this.closePrice = closePrice; ! this.maxPrice = maxPrice; ! this.minPrice = minPrice; ! this.variation = variation; ! this.previousPrice = previousPrice; ! this.amount = amount; this.volume = volume; this.trades = trades; } ! public Tick(double openPrice, double closePrice, double maxPrice, double minPrice) { ! super(); this.openPrice = openPrice; this.closePrice = closePrice; ! this.maxPrice = maxPrice; ! this.minPrice = minPrice; } public double getClosePrice() { return closePrice; *************** *** 58,72 **** } - public double getMaxPrice() { return maxPrice; } - public double getAmount() { return amount; } - public double getVolume() { return volume; --- 65,76 ---- *************** *** 75,91 **** @Override public boolean equals(Object obj) { ! if(obj instanceof Tick) ! { Tick tick = (Tick) obj; ! return (variation == tick.getVariation()) && ! (closePrice == tick.getClosePrice()) && ! (data.equals(tick.getData())) && ! (maxPrice == tick.getMaxPrice()) && ! (minPrice == tick.getMinPrice()) && ! (openPrice == tick.getOpenPrice()) && ! (previousPrice == getPreviousPrice()) && ! (trades == tick.getTrades()) && ! (amount == tick.getAmount()) && ! (volume == tick.getVolume()); } return false; --- 79,89 ---- @Override public boolean equals(Object obj) { ! if (obj instanceof Tick) { Tick tick = (Tick) obj; ! return (variation == tick.getVariation()) && (closePrice == tick.getClosePrice()) ! && (data.equals(tick.getData())) && (maxPrice == tick.getMaxPrice()) ! && (minPrice == tick.getMinPrice()) && (openPrice == tick.getOpenPrice()) ! && (previousPrice == getPreviousPrice()) && (trades == tick.getTrades()) ! && (amount == tick.getAmount()) && (volume == tick.getVolume()); } return false; *************** *** 96,105 **** } - public double getMinPrice() { return minPrice; } - public double getPreviousPrice() { return previousPrice; --- 94,101 ---- *************** *** 110,113 **** } - } --- 106,108 ---- Index: TimeSeries.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/TimeSeries.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TimeSeries.java 12 May 2007 15:37:07 -0000 1.2 --- TimeSeries.java 17 May 2007 23:06:56 -0000 1.3 *************** *** 3,8 **** public interface TimeSeries { ! Tick getTick(int i); ! int getSize(); } --- 3,9 ---- public interface TimeSeries { ! Tick getTick(int i); ! ! int getSize(); } |