本文整理汇总了Java中org.projectfloodlight.openflow.types.OFAuxId.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java OFAuxId.getValue方法的具体用法?Java OFAuxId.getValue怎么用?Java OFAuxId.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.projectfloodlight.openflow.types.OFAuxId
的用法示例。
在下文中一共展示了OFAuxId.getValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calcNumRequiredConnections
import org.projectfloodlight.openflow.types.OFAuxId; //导入方法依赖的package包/类
private int calcNumRequiredConnections() {
if(!this.logicalOFMessageCategories.isEmpty()){
// We use tree set here to maintain ordering
TreeSet<OFAuxId> auxConnections = new TreeSet<OFAuxId>();
for(LogicalOFMessageCategory category : this.logicalOFMessageCategories){
auxConnections.add(category.getAuxId());
}
OFAuxId first = auxConnections.first();
OFAuxId last = auxConnections.last();
// Check for contiguous set (1....size())
if(first.equals(OFAuxId.MAIN)) {
if(last.getValue() != auxConnections.size() - 1){
throw new IllegalStateException("Logical OF message categories must maintain contiguous OF Aux Ids! i.e. (0,1,2,3,4,5)");
}
return auxConnections.size() - 1;
} else if(first.equals(OFAuxId.of(1))) {
if(last.getValue() != auxConnections.size()){
throw new IllegalStateException("Logical OF message categories must maintain contiguous OF Aux Ids! i.e. (1,2,3,4,5)");
}
return auxConnections.size();
} else {
throw new IllegalStateException("Logical OF message categories must start at 0 (MAIN) or 1");
}
} else {
return 0;
}
}