本文整理汇总了Java中com.ib.controller.Formats类的典型用法代码示例。如果您正苦于以下问题:Java Formats类的具体用法?Java Formats怎么用?Java Formats使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Formats类属于com.ib.controller包,在下文中一共展示了Formats类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connected
import com.ib.controller.Formats; //导入依赖的package包/类
@Override public void connected() {
show( "connected");
m_connectionPanel.m_status.setText( "connected");
controller().reqCurrentTime( new ITimeHandler() {
@Override public void currentTime(long time) {
show( "Server date/time is " + Formats.fmtDate(time * 1000) );
}
});
controller().reqBulletins( true, new IBulletinHandler() {
@Override public void bulletin(int msgId, NewsType newsType, String message, String exchange) {
String str = String.format( "Received bulletin: type=%s exchange=%s", newsType, exchange);
show( str);
show( message);
}
});
}
示例2: connected
import com.ib.controller.Formats; //导入依赖的package包/类
@Override public void connected() {
show( "connected");
m_connectionPanel.m_status.setText( "connected");
m_controller.reqCurrentTime( new ITimeHandler() {
@Override public void currentTime(long time) {
show( "Server date/time is " + Formats.fmtDate(time * 1000) );
}
});
m_controller.reqBulletins( true, new IBulletinHandler() {
@Override public void bulletin(int msgId, NewsType newsType, String message, String exchange) {
String str = String.format( "Received bulletin: type=%s exchange=%s", newsType, exchange);
show( str);
show( message);
}
});
}
示例3: getValueAt
import com.ib.controller.Formats; //导入依赖的package包/类
@Override public Object getValueAt(int rowIn, int col) {
PositionRow row = m_list.get( rowIn);
switch( col) {
case 0: return row.m_account;
case 1: return row.m_modelCode;
case 2: return row.m_contract.description();
case 3: return row.m_position;
case 4: return Formats.fmt( row.m_avgCost);
default: return null;
}
}
示例4: getValueAt
import com.ib.controller.Formats; //导入依赖的package包/类
@Override public Object getValueAt(int rowIn, int col) {
PositionRow row = m_list.get( rowIn);
switch( col) {
case 0: return row.m_account;
case 1: return row.m_contract.description();
case 2: return row.m_position;
case 3: return Formats.fmt( row.m_avgCost);
default: return null;
}
}
示例5: getValueAt
import com.ib.controller.Formats; //导入依赖的package包/类
@Override public Object getValueAt(int rowIn, int col) {
TopRow row = m_rows.get( rowIn);
switch( col) {
case 0: return row.m_description;
case 1: return row.m_bidSize;
case 2: return fmt( row.m_bid);
case 3: return fmt( row.m_ask);
case 4: return row.m_askSize;
case 5: return fmt( row.m_last);
case 6: return fmtTime( row.m_lastTime);
case 7: return row.change();
case 8: return Formats.fmt0( row.m_volume);
default: return null;
}
}
示例6: fmtPct
import com.ib.controller.Formats; //导入依赖的package包/类
public String fmtPct(String val) {
return val == null || val.length() == 0 ? null : Formats.fmtPct( Double.parseDouble( val) );
}
示例7: fmtTime
import com.ib.controller.Formats; //导入依赖的package包/类
public String fmtTime(String val) {
return val == null || val.length() == 0 || val.equals( "0") ? null : Formats.fmtDate( Long.parseLong( val) * 1000);
}