本文整理汇总了Java中javax.management.openmbean.ArrayType.getDimension方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayType.getDimension方法的具体用法?Java ArrayType.getDimension怎么用?Java ArrayType.getDimension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.management.openmbean.ArrayType
的用法示例。
在下文中一共展示了ArrayType.getDimension方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVersionedArrayType
import javax.management.openmbean.ArrayType; //导入方法依赖的package包/类
private ArrayType<?> getVersionedArrayType(ArrayType<?> type, String version)
throws OpenDataException
{
if (type.isPrimitiveArray()) {
return type;
}
OpenType<?> ot = getVersionedType(
type.getElementOpenType(),
version
);
if (ot instanceof SimpleType) {
return new ArrayType<>((SimpleType<?>)ot, type.isPrimitiveArray());
} else {
return new ArrayType<>(type.getDimension(), ot);
}
}
示例2: isTypeMatched
import javax.management.openmbean.ArrayType; //导入方法依赖的package包/类
protected static boolean isTypeMatched(ArrayType<?> type1, ArrayType<?> type2) {
if (type1 == type2) return true;
int dim1 = type1.getDimension();
int dim2 = type2.getDimension();
// check if the array dimensions are the same
if (dim1 != dim2)
return false;
return isTypeMatched(type1.getElementOpenType(), type2.getElementOpenType());
}
示例3: checkGetters
import javax.management.openmbean.ArrayType; //导入方法依赖的package包/类
private static int checkGetters(ArrayType a,
String className,
String description,
String typeName,
boolean isArray,
boolean isPrimitiveArray,
int dimension) {
int error = 0;
if (a.getClassName().equals(className)) {
System.out.println("\tArrayType.getClassName() OK!");
} else {
System.out.println("\tArrayType.getClassName() KO!");
System.out.println("\t\t---> expecting " + className);
error++;
}
if (a.getDescription().equals(description)) {
System.out.println("\tArrayType.getDescription() OK!");
} else {
System.out.println("\tArrayType.getDescription() KO!");
System.out.println("\t\t---> expecting " + description);
error++;
}
if (a.getTypeName().equals(typeName)) {
System.out.println("\tArrayType.getTypeName() OK!");
} else {
System.out.println("\tArrayType.getTypeName() KO!");
System.out.println("\t\t---> expecting " + typeName);
error++;
}
if (a.isArray() == isArray) {
System.out.println("\tArrayType.isArray() OK!");
} else {
System.out.println("\tArrayType.isArray() KO!");
System.out.println("\t\t---> expecting " + isArray);
error++;
}
if (a.isPrimitiveArray() == isPrimitiveArray) {
System.out.println("\tArrayType.isPrimitiveArray() OK!");
} else {
System.out.println("\tArrayType.isPrimitiveArray() KO!");
System.out.println("\t\t---> expecting " + isPrimitiveArray);
error++;
}
if (a.getDimension() == dimension) {
System.out.println("\tArrayType.getDimension() OK!");
} else {
System.out.println("\tArrayType.getDimension() KO!");
System.out.println("\t\t---> expecting " + dimension);
error++;
}
if (error > 0) {
System.out.println("Test failed!");
return 1;
} else {
System.out.println("Test passed!");
return 0;
}
}