本文整理汇总了Java中com.paritytrading.parity.net.pmd.PMD类的典型用法代码示例。如果您正苦于以下问题:Java PMD类的具体用法?Java PMD怎么用?Java PMD使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PMD类属于com.paritytrading.parity.net.pmd包,在下文中一共展示了PMD类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PMDSink
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
public PMDSink(File file) throws IOException {
version = new PMD.Version();
seconds = new PMD.Seconds();
orderAdded = new PMD.OrderAdded();
orderExecuted = new PMD.OrderExecuted();
orderCanceled = new PMD.OrderCanceled();
orderDeleted = new PMD.OrderDeleted();
brokenTrade = new PMD.BrokenTrade();
currentSecond = 0;
instrument = new Long2LongOpenHashMap();
side = new Long2ByteOpenHashMap();
buffer = ByteBuffer.allocate(BUFFER_CAPACITY);
writer = BinaryFILEWriter.open(file);
}
示例2: write
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
private void write(long timestampHigh, long timestampLow, PMD.Message message) throws IOException {
long second = second(timestampHigh, timestampLow);
if (currentSecond != second) {
currentSecond = second;
seconds.second = second;
buffer.clear();
seconds.put(buffer);
buffer.flip();
writer.write(buffer);
}
buffer.clear();
message.put(buffer);
buffer.flip();
writer.write(buffer);
}
示例3: send
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
private void send(PMD.Message message) {
buffer.clear();
message.put(buffer);
buffer.flip();
try {
packet.put(buffer);
transport.send(packet);
packet.payload().flip();
messages.put(packet);
packet.clear();
} catch (IOException e) {
fatal(e);
}
}
示例4: MarketData
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
private MarketData(MoldUDP64Server transport, MoldUDP64RequestServer requestTransport) {
this.version = new PMD.Version();
this.orderAdded = new PMD.OrderAdded();
this.orderExecuted = new PMD.OrderExecuted();
this.orderCanceled = new PMD.OrderCanceled();
this.transport = transport;
this.requestTransport = requestTransport;
this.messages = new MoldUDP64DefaultMessageStore();
this.packet = new MoldUDP64DownstreamPacket();
this.buffer = ByteBuffer.allocateDirect(1024);
}
示例5: version
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
@Override
public void version(PMD.Version message) {
}
示例6: seconds
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
@Override
public void seconds(PMD.Seconds message) {
}
示例7: orderAdded
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
@Override
public void orderAdded(PMD.OrderAdded message) {
market.add(message.instrument, message.orderNumber, side(message.side),
message.price, message.quantity);
}
示例8: orderExecuted
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
@Override
public void orderExecuted(PMD.OrderExecuted message) {
market.execute(message.orderNumber, message.quantity);
}
示例9: orderCanceled
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
@Override
public void orderCanceled(PMD.OrderCanceled message) {
market.cancel(message.orderNumber, message.canceledQuantity);
}
示例10: orderDeleted
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
@Override
public void orderDeleted(PMD.OrderDeleted message) {
market.delete(message.orderNumber);
}
示例11: brokenTrade
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
@Override
public void brokenTrade(PMD.BrokenTrade message) {
}
示例12: side
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
private byte side(byte buySellIndicator) {
return buySellIndicator == ITCH50.BUY ? PMD.BUY : PMD.SELL;
}
示例13: version
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
@Override
public void version(PMD.Version message) {
if (message.version != PMD.VERSION)
error("Unsupported protocol version");
}
示例14: orderAdded
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
@Override
public void orderAdded(PMD.OrderAdded message) {
listener.timestamp(message.timestamp);
market.add(message.instrument, message.orderNumber, side(message.side), message.price, message.quantity);
}
示例15: orderExecuted
import com.paritytrading.parity.net.pmd.PMD; //导入依赖的package包/类
@Override
public void orderExecuted(PMD.OrderExecuted message) {
listener.timestamp(message.timestamp);
market.execute(message.orderNumber, message.quantity);
}