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


Java UnsignedInts.compare方法代码示例

本文整理汇总了Java中com.google.common.primitives.UnsignedInts.compare方法的典型用法代码示例。如果您正苦于以下问题:Java UnsignedInts.compare方法的具体用法?Java UnsignedInts.compare怎么用?Java UnsignedInts.compare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.primitives.UnsignedInts的用法示例。


在下文中一共展示了UnsignedInts.compare方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: of

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
/**
 * get an OFGroup object corresponding to a raw 32-bit integer group number.
 * NOTE: The group object may either be newly allocated or cached. Do not
 * rely on either behavior.
 *
 * @param groupNumber the raw 32-bit group number
 * @return a corresponding OFPort
 */
public static OFGroup of(final int groupNumber) {
    switch(groupNumber) {
        case ZERO_VAL:
            return MAX;
        case MAX_VAL:
            return MAX;
        case ALL_VAL:
            return ALL;
        case ANY_VAL:
            return ANY;
        default:
            if(UnsignedInts.compare(groupNumber, MAX_VAL) > 0) {
                // greater than max_val, but not one of the reserved values
                throw new IllegalArgumentException("Unknown special group number: "
                        + groupNumber);
            }
            return new OFGroup(groupNumber);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:28,代码来源:OFGroup.java

示例2: of

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
/**
 * get an OFGroup object corresponding to a raw 32-bit integer group number.
 * NOTE: The group object may either be newly allocated or cached. Do not
 * rely on either behavior.
 *
 * @param groupNumber the raw 32-bit group number
 * @return a corresponding OFPort
 */
public static OFGroup of(final int groupNumber) {
    switch(groupNumber) {
        case ZERO_VAL:
            return ZERO;
        case MAX_VAL:
            return MAX;
        case ALL_VAL:
            return ALL;
        case ANY_VAL:
            return ANY;
        default:
            if(UnsignedInts.compare(groupNumber, MAX_VAL) > 0) {
                // greater than max_val, but not one of the reserved values
                throw new IllegalArgumentException("Unknown special group number: "
                        + groupNumber);
            }
            return new OFGroup(groupNumber);
    }
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:28,代码来源:OFGroup.java

示例3: compareTo

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(PacketType o) {
    int res = UnsignedInts.compare(this.namespace, o.namespace);
    if(res != 0)
        return res;

    return UnsignedInts.compare(this.nsType, o.nsType);
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:9,代码来源:PacketType.java

示例4: compareTo

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(U32 o) {
    return UnsignedInts.compare(raw, o.raw);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:5,代码来源:U32.java

示例5: compareTo

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(IPv6FlowLabel o) {
    return UnsignedInts.compare(label, o.label);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:5,代码来源:IPv6FlowLabel.java

示例6: compareTo

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(OFBufferId o) {
    return UnsignedInts.compare(rawValue, o.rawValue);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:5,代码来源:OFBufferId.java

示例7: compareTo

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(BundleId o) {
    return UnsignedInts.compare(rawValue, rawValue);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:5,代码来源:BundleId.java

示例8: compareTo

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(VRF o) {
    return UnsignedInts.compare(rawValue, o.rawValue);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:5,代码来源:VRF.java

示例9: compareTo

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(IPv4Address o) {
    return UnsignedInts.compare(rawValue, o.rawValue);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:5,代码来源:IPv4Address.java

示例10: compareTo

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(OFPort o) {
    return UnsignedInts.compare(this.portNumber, o.portNumber);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:5,代码来源:OFPort.java

示例11: compareTo

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(GenTableId other) {
    return UnsignedInts.compare(this.id, other.id);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:5,代码来源:GenTableId.java

示例12: compareTo

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(OFGroup o) {
    return UnsignedInts.compare(this.groupNumber, o.groupNumber);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:5,代码来源:OFGroup.java

示例13: compareTo

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(UDF o) {
    return UnsignedInts.compare(rawValue, o.rawValue);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:5,代码来源:UDF.java

示例14: compareTo

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(LagId o) {
    return UnsignedInts.compare(rawValue, o.rawValue);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:5,代码来源:LagId.java

示例15: compareTo

import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(EthType o) {
    return UnsignedInts.compare(rawValue, o.rawValue);
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:5,代码来源:EthType.java


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