文件一public class BillDataVO
{
public int time;
public float curPrice;
public float balancePrice;
public double totalMoney;
public long totalAmount;
public int reserveCount;
public float buyPrice;
public float sellPrice;
public int openAmount;
public int closeAmount;
public int tradeCue;
}
文件二public class MinDataVO
{
public int time;
public float curPrice;
public double totalMoney;
public long totalAmount;
public int reserveCount;
public float averPrice;
}
{
public int time;
public float curPrice;
public float balancePrice;
public double totalMoney;
public long totalAmount;
public int reserveCount;
public float buyPrice;
public float sellPrice;
public int openAmount;
public int closeAmount;
public int tradeCue;
}
文件二public class MinDataVO
{
public int time;
public float curPrice;
public double totalMoney;
public long totalAmount;
public int reserveCount;
public float averPrice;
}
/* */ {
/* */ public Date time;
/* */ public String code;
/* */ public String name;
/* */ public float yesterBalancePrice;
/* */ public float closePrice;
/* */ public float openPrice;
/* */ public float highPrice;
/* */ public float lowPrice;
/* */ public float curPrice;
/* */ public float upRate;
/* */ public float shakeRate;
/* */ public int curAmount;
/* */ public int openAmount;
/* */ public int closeAmount;
/* */ public int reserveCount;
/* */ public int reserveChange;
/* */ public float balancePrice;
/* */ public double totalMoney;
/* */ public long totalAmount;
/* 102 */ public float[] buyPrice = new float[5];
/* */
/* 106 */ public float[] sellPrice = new float[5];
/* */
/* 110 */ public int[] buyAmount = new int[5];
/* */
/* 114 */ public int[] sellAmount = new int[5];
/* */ public int outAmount;
/* */ public int inAmount;
/* */ public int tradeCue;
/* */ public int no;
/* */ public long averAmount5;
/* 140 */ public boolean bUpdated = true;
/* */ public float amountRate;
/* */ public float consignRate;
/* */ public float upRate5min;
/* 159 */ public Vector billData = new Vector();
/* */
/* */ public Object clone()
/* */ {
/* 163 */ ProductDataVO data = new ProductDataVO();
/* 164 */ data.amountRate = this.amountRate;
/* 165 */ data.averAmount5 = this.averAmount5;
/* 166 */ data.balancePrice = this.balancePrice;
/* 167 */ data.billData = this.billData;
/* 168 */ for (int i = 0; i < 5; ++i)
/* */ {
/* 170 */ data.buyAmount[i] = this.buyAmount[i];
/* 171 */ data.buyPrice[i] = this.buyPrice[i];
/* 172 */ data.sellAmount[i] = this.sellAmount[i];
/* 173 */ data.sellPrice[i] = this.sellPrice[i];
/* */ }
/* 175 */ data.closeAmount = this.closeAmount;
/* 176 */ data.closePrice = this.closeAmount;
/* 177 */ data.code = this.code;
/* 178 */ data.consignRate = this.closeAmount;
/* 179 */ data.curAmount = this.curAmount;
/* 180 */ data.curPrice = this.curPrice;
/* 181 */ data.highPrice = this.highPrice;
/* 182 */ data.inAmount = this.inAmount;
/* 183 */ data.lowPrice = this.lowPrice;
/* 184 */ data.name = this.name;
/* 185 */ data.no = this.no;
/* 186 */ data.openAmount = this.openAmount;
/* 187 */ data.openPrice = this.openPrice;
/* 188 */ data.outAmount = this.outAmount;
/* 189 */ data.reserveChange = this.reserveChange;
/* 190 */ data.reserveCount = this.reserveCount;
/* 191 */ data.time = this.time;
/* 192 */ data.totalAmount = this.totalAmount;
/* 193 */ data.totalMoney = this.totalMoney;
/* 194 */ data.tradeCue = this.tradeCue;
/* 195 */ data.upRate = this.tradeCue;
/* 196 */ data.shakeRate = this.shakeRate;
/* 197 */ data.upRate5min = this.upRate5min;
/* 198 */ data.yesterBalancePrice = this.yesterBalancePrice;
/* 199 */ return data;
/* */ }
/* */
/* */ public String toString() {
/* 203 */ String sep = "\n";
/* 204 */ StringBuffer sb = new StringBuffer();
/* 205 */ sb.append("**" + super.getClass().getName() + "**" + sep);
/* 206 */ sb.append("Time:" + this.time + sep);
/* 207 */ sb.append("Code:" + this.code + sep);
/* 208 */ sb.append("Name:" + this.name + sep);
/* 209 */ sb.append("YesterPrice:" + this.yesterBalancePrice + sep);
/* 210 */ sb.append("ClosePrice:" + this.closePrice + sep);
/* 211 */ sb.append("OpenPrice:" + this.openPrice + sep);
/* 212 */ sb.append("HighPrice:" + this.highPrice + sep);
/* 213 */ sb.append("LowPrice:" + this.lowPrice + sep);
/* 214 */ sb.append("CurPrice:" + this.curPrice + sep);
/* 215 */ sb.append("CurAmount:" + this.curAmount + sep);
/* 216 */ sb.append("OpenAmount:" + this.openAmount + sep);
/* 217 */ sb.append("CloseAmount:" + this.closeAmount + sep);
/* 218 */ sb.append("ReserveCount:" + this.reserveCount + sep);
/* 219 */ sb.append("AverageValue:" + this.balancePrice + sep);
/* 220 */ sb.append("TotalMoney:" + this.totalMoney + sep);
/* 221 */ sb.append("TotalAmount:" + this.totalAmount + sep);
/* 222 */ for (int i = 0; i < 5; ++i)
/* */ {
/* 224 */ sb.append("BuyPrice" + (i + 1) + ":" + this.buyPrice[i] + sep);
/* 225 */ sb.append("SellPrice" + (i + 1) + ":" + this.sellPrice[i] + sep);
/* 226 */ sb.append("BuyAmount" + (i + 1) + ":" + this.buyAmount[i] + sep);
/* 227 */ sb.append("SellAmount" + (i + 1) + ":" + this.sellAmount[i] + sep);
/* */ }
/* 229 */ sb.append("OutAmount:" + this.outAmount + sep);
/* 230 */ sb.append("InAmount:" + this.inAmount + sep);
/* 231 */ sb.append("TradeCue:" + this.tradeCue + sep);
/* 232 */ sb.append("NO:" + this.no + sep);
/* 233 */ sb.append("AverAmount5:" + this.averAmount5 + sep);
/* 234 */ sb.append("AmountRate:" + this.amountRate + sep);
/* 235 */ sb.append(sep);
/* 236 */ return sb.toString();
/* */ }
/* */ }
/* */ {
/* */ public String code;
/* */ public String name;
/* */ public int type;
/* */ public int openTime;
/* 46 */ public int[] tradeSecNo = new int[1];
/* */ public int closeTime;
/* */ public Date modifyTime;
/* */ public static final int TYPE_INVALID = -1;
/* */ public static final int TYPE_COMMON = 0;
/* */ public static final int TYPE_CANCEL = 1;
/* */ public static final int TYPE_INDEX = 2;
/* */ public static final int TYPE_INDEX_MAIN = 3;
/* */ public static final int TYPE_SERIES = 4;
/* */ public static final int TYPE_PAUSE = 5;
/* */ public static final int TYPE_FINISHIED = 6;
/* */ public int status;
/* 83 */ public String[] pyName = new String[0];
/* */
/* 85 */ public float fUnit = 1.0F;
/* */
/* */ public String toString()
/* */ {
/* 89 */ String sep = "\n";
/* 90 */ StringBuffer sb = new StringBuffer();
/* 91 */ sb.append("**" + super.getClass().getName() + "**" + sep);
/* 92 */ sb.append("Code:" + this.code + sep);
/* 93 */ sb.append("Name:" + this.name + sep);
/* 94 */ sb.append("Type:" + this.type + sep);
/* 95 */ sb.append("CloseTime:" + this.closeTime + sep);
/* 96 */ sb.append("CreateTime:" + this.openTime + sep);
/* 97 */ sb.append("ModifyTime:" + this.modifyTime + sep);
/* 98 */ sb.append("Status:" + this.status + sep);
/* 99 */ sb.append("pyName.length:" + this.pyName.length + sep);
/* 100 */ for (int i = 0; i < this.pyName.length; ++i)
/* */ {
/* 102 */ sb.append("pyName[" + i + "]:" + this.pyName[i] + sep);
/* */ }
/* */
/* 105 */ sb.append(sep);
/* 106 */ return sb.toString() + super.toString();
/* */ }
/* */ }文件五
public class TradeTimeVO
/* */ {
/* */ public int orderID;
/* */ public int beginTime;
/* */ public int endTime;
/* */ public int status;
/* 42 */ public Date modifytime = new Date();
/* */
/* */ public String toString()
/* */ {
/* 46 */ String sep = "\n";
/* 47 */ StringBuffer sb = new StringBuffer();
/* 48 */ sb.append("**" + super.getClass().getName() + "**" + sep);
/* 49 */ sb.append("OrderID:" + this.orderID + sep);
/* 50 */ sb.append("BeginTime:" + this.beginTime + sep);
/* 51 */ sb.append("EndTime:" + this.endTime + sep);
/* 52 */ sb.append("Status:" + this.status + sep);
/* 53 */ sb.append("Modifytime:" + this.modifytime + sep);
/* 54 */ sb.append(sep);
/* 55 */ return sb.toString();
/* */ }
/* */
/* */ public static String timeIntToString(int iTime)
/* */ {
/* 60 */ return (iTime / 100) + ":" + (iTime % 100);
/* */ }
/* */
/* */ public static int timeStringToInt(String strTime)
/* */ {
/* 65 */ strTime.replaceAll(":", "");
/* 66 */ return Integer.parseInt(strTime);
/* */ }
/* */
/* */ public static int GetTotalMinute(TradeTimeVO[] timeRange)
/* */ {
/* 75 */ int iMin = 0;
/* 76 */ for (int i = 0; i < timeRange.length; ++i)
/* */ {
/* 79 */ iMin = iMin + timeRange[i].endTime / 100 * 60 + timeRange[i].endTime % 100 - (
/* 79 */ timeRange[i].beginTime / 100 * 60 + timeRange[i].beginTime % 100);
/* */ }
/* 81 */ return iMin;
/* */ }
/* */
/* */ public static int GetTimeFromIndex(int iIndex, TradeTimeVO[] timeRange)
/* */ {
/* 92 */ int iIndexCur = iIndex + 1;
/* 93 */ for (int i = 0; i < timeRange.length; ++i)
/* */ {
/* 95 */ int iRange = timeRange[i].endTime / 100 * 60 + timeRange[i].endTime % 100 - (
/* 96 */ timeRange[i].beginTime / 100 * 60 + timeRange[i].beginTime % 100);
/* 97 */ if (iRange < iIndexCur) {
/* 98 */ iIndexCur -= iRange;
/* */ }
/* */ else {
/* 101 */ int iTime = timeRange[i].beginTime / 100 * 60 +
/* 102 */ timeRange[i].beginTime % 100 +
/* 102 */ iIndexCur;
/* 103 */ iTime = iTime / 60 * 100 + iTime % 60;
/* 104 */ return iTime;
/* */ }
/* */ }
/* 107 */ return -1;
/* */ }
/* */
/* */ public static int GetIndexFromTime(int iTime, TradeTimeVO[] timeRange)
/* */ {
/* 118 */ int iIndex = -1;
/* 119 */ for (int i = 0; i < timeRange.length; ++i)
/* */ {
/* 121 */ if (iTime < timeRange[i].beginTime)
/* 122 */ return iIndex;
/* 123 */ if ((timeRange[i].endTime >= iTime) && (iTime >= timeRange[i].beginTime))
/* */ {
/* 125 */ iIndex += iTime / 100 * 60 + iTime % 100 - (timeRange[i].beginTime / 100 * 60 + timeRange[i].beginTime % 100);
/* */ }
/* */ else {
/* 128 */ iIndex += timeRange[i].endTime / 100 * 60 + timeRange[i].endTime % 100 - (timeRange[i].beginTime / 100 * 60 + timeRange[i].beginTime % 100);
/* */ }
/* */ }
/* 131 */ if (iIndex < 0)
/* 132 */ iIndex = 0;
/* 133 */ return iIndex;
/* */ }
/* */
/* */ public static void main(String[] arg)
/* */ {
/* 138 */ TradeTimeVO[] vo = new TradeTimeVO[1];
/* 139 */ vo[0] = new TradeTimeVO();
/* 140 */ vo[0].beginTime = 930;
/* 141 */ vo[0].endTime = 1800;
/* 142 */ vo[0].orderID = 0;
/* 143 */ System.out.println(GetIndexFromTime(931, vo));
/* 144 */ System.out.println(GetTimeFromIndex(0, vo));
/* */ }
/* */ }