当前位置: 首页>>代码示例>>Java>>正文


Java NumberFormatter类代码示例

本文整理汇总了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;
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:17,代码来源:FlowViewMessageHandler.java

示例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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:13,代码来源:FlowViewMessageHandler.java

示例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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:12,代码来源:PortViewMessageHandler.java

示例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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:10,代码来源:MeterViewMessageHandler.java

示例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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:GroupViewMessageHandler.java

示例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);
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:37,代码来源:FlowViewMessageHandler.java

示例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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:7,代码来源:ProcessorViewMessageHandler.java


注:本文中的org.onosproject.ui.table.cell.NumberFormatter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。