coin实时计算类图
2022-05-20 14:35:21 24 举报
类图
作者其他创作
大纲/内容
继承
AbstractComputeHandler(算法基类)
+ run(QueueData<T> data)+ match(DataTypeEnum type)
QueueData<T>(queue存储对象)
+ type:DataTypeEnum+ T:data
CoinChangePercent(涨跌幅)
+ coinId:String+ priceChangePercent:double- addtime:long
使用
ExchangeValueComputorHandler(汇率算法)
CoinInfo币种信息
+CoinId:int+Name:String
GlobalAvgPrice(全球均价)
+ coinId:String+ priceUsd:double- addtime:long
CoinPairTradeData(MQ数据)
+ TradeId:String+ CoinPairId:int+ TradePrice:Double
MarketValueComputorHandler(24小时涨跌幅、最大最小算法)
DataTypeEnum
+ int:type +String:name
+ operation1(params):returnType- operation2(params)- operation3()
依赖
TradeDataConsumer(MQ消费者)
-registerMessageListener()-run()-shutdown()
调度类
+thredPool:ExecutorService+handlerPool:List<AbstractComputeHandler>
- threadPoolRun()- getMatchedHandlers(DataTypeEnum type):List<AbstractComputeHandler>
GloablePriceComputorHandler(均价算法)
MarketValueComputorHandler(市值算法)
CoinPairInfo交易对信息
+CoinPairId:String+Name:String
+SplitName():String
0 条评论
下一页