本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
示例4: compareTo
import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(U32 o) {
return UnsignedInts.compare(raw, o.raw);
}
示例5: compareTo
import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(IPv6FlowLabel o) {
return UnsignedInts.compare(label, o.label);
}
示例6: compareTo
import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(OFBufferId o) {
return UnsignedInts.compare(rawValue, o.rawValue);
}
示例7: compareTo
import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(BundleId o) {
return UnsignedInts.compare(rawValue, rawValue);
}
示例8: compareTo
import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(VRF o) {
return UnsignedInts.compare(rawValue, o.rawValue);
}
示例9: compareTo
import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(IPv4Address o) {
return UnsignedInts.compare(rawValue, o.rawValue);
}
示例10: compareTo
import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(OFPort o) {
return UnsignedInts.compare(this.portNumber, o.portNumber);
}
示例11: compareTo
import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(GenTableId other) {
return UnsignedInts.compare(this.id, other.id);
}
示例12: compareTo
import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(OFGroup o) {
return UnsignedInts.compare(this.groupNumber, o.groupNumber);
}
示例13: compareTo
import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(UDF o) {
return UnsignedInts.compare(rawValue, o.rawValue);
}
示例14: compareTo
import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(LagId o) {
return UnsignedInts.compare(rawValue, o.rawValue);
}
示例15: compareTo
import com.google.common.primitives.UnsignedInts; //导入方法依赖的package包/类
@Override
public int compareTo(EthType o) {
return UnsignedInts.compare(rawValue, o.rawValue);
}