本文整理汇总了Java中org.onosproject.ui.table.cell.NumberFormatter类的典型用法代码示例。如果您正苦于以下问题:Java NumberFormatter类的具体用法?Java NumberFormatter怎么用?Java NumberFormatter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NumberFormatter类属于org.onosproject.ui.table.cell包,在下文中一共展示了NumberFormatter类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTableModel
import org.onosproject.ui.table.cell.NumberFormatter; //导入依赖的package包/类
@Override
protected TableModel createTableModel() {
TableModel tm = super.createTableModel();
tm.setFormatter(ID, HexLongFormatter.INSTANCE);
tm.setFormatter(STATE, EnumFormatter.INSTANCE);
tm.setFormatter(BYTES, NumberFormatter.INTEGER);
tm.setFormatter(PACKETS, NumberFormatter.INTEGER);
tm.setFormatter(DURATION, NumberFormatter.INTEGER);
tm.setFormatter(SELECTOR_C, new SelectorShortFormatter());
tm.setFormatter(SELECTOR, new SelectorFormatter());
tm.setFormatter(TREATMENT_C, new TreatmentShortFormatter());
tm.setFormatter(TREATMENT, new TreatmentFormatter());
tm.setFormatter(TABLE_NAME, DefaultCellFormatter.INSTANCE);
return tm;
}
示例2: createTableModel
import org.onosproject.ui.table.cell.NumberFormatter; //导入依赖的package包/类
@Override
protected TableModel createTableModel() {
TableModel tm = super.createTableModel();
tm.setFormatter(ID, HexLongFormatter.INSTANCE);
tm.setFormatter(GROUP_ID, HexFormatter.INSTANCE);
tm.setFormatter(STATE, EnumFormatter.INSTANCE);
tm.setFormatter(PACKETS, NumberFormatter.INTEGER);
tm.setFormatter(BYTES, NumberFormatter.INTEGER);
tm.setFormatter(SELECTOR, new SelectorFormatter());
tm.setFormatter(TREATMENT, new TreatmentFormatter());
return tm;
}
示例3: createTableModel
import org.onosproject.ui.table.cell.NumberFormatter; //导入依赖的package包/类
@Override
protected TableModel createTableModel() {
TableModel tm = super.createTableModel();
tm.setFormatter(PKT_RX, NumberFormatter.INTEGER);
tm.setFormatter(PKT_TX, NumberFormatter.INTEGER);
tm.setFormatter(BYTES_RX, NumberFormatter.INTEGER);
tm.setFormatter(BYTES_TX, NumberFormatter.INTEGER);
tm.setFormatter(PKT_RX_DRP, NumberFormatter.INTEGER);
tm.setFormatter(PKT_TX_DRP, NumberFormatter.INTEGER);
return tm;
}
示例4: createTableModel
import org.onosproject.ui.table.cell.NumberFormatter; //导入依赖的package包/类
@Override
protected TableModel createTableModel() {
TableModel tm = super.createTableModel();
tm.setFormatter(ID, HexLongFormatter.INSTANCE);
tm.setFormatter(PACKETS, NumberFormatter.INTEGER);
tm.setFormatter(BYTES, NumberFormatter.INTEGER);
tm.setFormatter(BANDS, new BandFormatter());
return tm;
}
示例5: createTableModel
import org.onosproject.ui.table.cell.NumberFormatter; //导入依赖的package包/类
@Override
protected TableModel createTableModel() {
TableModel tm = super.createTableModel();
tm.setFormatter(ID, HexFormatter.INSTANCE);
tm.setFormatter(TYPE, EnumFormatter.INSTANCE);
tm.setFormatter(PACKETS, NumberFormatter.INTEGER);
tm.setFormatter(BYTES, NumberFormatter.INTEGER);
tm.setFormatter(BUCKETS, new BucketFormatter());
return tm;
}
示例6: process
import org.onosproject.ui.table.cell.NumberFormatter; //导入依赖的package包/类
@Override
public void process(ObjectNode payload) {
String flowId = string(payload, FLOW_ID);
String appId = string(payload, APP_ID);
FlowEntry flow = findFlowById(appId, flowId);
if (flow != null) {
ObjectNode data = objectNode();
data.put(FLOW_ID, decorateFlowId(flow));
data.put(STATE, EnumFormatter.INSTANCE.format(flow.state()));
data.put(BYTES, NumberFormatter.INTEGER.format(flow.bytes()));
data.put(PACKETS, NumberFormatter.INTEGER.format(flow.packets()));
data.put(DURATION, NumberFormatter.INTEGER.format(flow.life()));
data.put(FLOW_PRIORITY, flow.priority());
data.put(TABLE_NAME, flow.table().toString());
data.put(APP_ID, flow.appId());
// NOTE: horribly inefficient... make a map and retrieve a single value...
data.put(APP_NAME, makeAppName(flow.appId(), appShortMap()));
data.put(GROUP_ID, decorateGroupId(flow));
data.put(IDLE_TIMEOUT, flow.timeout());
data.put(HARD_TIMEOUT, flow.hardTimeout());
data.put(PERMANENT, flow.isPermanent());
data.set(SELECTOR, jsonCriteria(flow));
data.set(TREATMENT, jsonTreatment(flow));
ObjectNode rootNode = objectNode();
rootNode.set(DETAILS, data);
sendMessage(FLOW_DETAILS_RESP, rootNode);
}
}
示例7: createTableModel
import org.onosproject.ui.table.cell.NumberFormatter; //导入依赖的package包/类
@Override
protected TableModel createTableModel() {
TableModel tm = super.createTableModel();
tm.setFormatter(AVG_MS, NumberFormatter.TO_5DP);
return tm;
}