當前位置: 首頁>>代碼示例>>Java>>正文


Java SimpleType.FLOAT屬性代碼示例

本文整理匯總了Java中javax.management.openmbean.SimpleType.FLOAT屬性的典型用法代碼示例。如果您正苦於以下問題:Java SimpleType.FLOAT屬性的具體用法?Java SimpleType.FLOAT怎麽用?Java SimpleType.FLOAT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javax.management.openmbean.SimpleType的用法示例。


在下文中一共展示了SimpleType.FLOAT屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: simpleTypeOf

private static SimpleType<?> simpleTypeOf(Class<?> clazz) throws IllegalArgumentException {
	if (clazz == boolean.class || clazz == Boolean.class) {
		return SimpleType.BOOLEAN;
	} else if (clazz == byte.class || clazz == Byte.class) {
		return SimpleType.BYTE;
	} else if (clazz == short.class || clazz == Short.class) {
		return SimpleType.SHORT;
	} else if (clazz == char.class || clazz == Character.class) {
		return SimpleType.CHARACTER;
	} else if (clazz == int.class || clazz == Integer.class) {
		return SimpleType.INTEGER;
	} else if (clazz == long.class || clazz == Long.class) {
		return SimpleType.LONG;
	} else if (clazz == float.class || clazz == Float.class) {
		return SimpleType.FLOAT;
	} else if (clazz == double.class || clazz == Double.class) {
		return SimpleType.DOUBLE;
	} else if (clazz == String.class) {
		return SimpleType.STRING;
	} else {
		throw new IllegalArgumentException("There is no SimpleType for " + clazz.getName());
	}
}
 
開發者ID:softindex,項目名稱:datakernel,代碼行數:23,代碼來源:AttributeNodeForSimpleType.java

示例2: getOpenType

public static OpenType<?> getOpenType(Object o)
{
    if(o instanceof Long)
    {
        return SimpleType.LONG;
    }
    else if(o instanceof String)
    {
        return SimpleType.STRING;
    }
    else if(o instanceof Date)
    {
        return SimpleType.DATE;
    }
    else if(o instanceof Integer)
    {
        return SimpleType.INTEGER;
    }
    else if(o instanceof Boolean)
    {
        return SimpleType.BOOLEAN;
    }
    else if(o instanceof Double)
    {
        return SimpleType.DOUBLE;
    }
    else if(o instanceof Float)
    {
        return SimpleType.FLOAT;
    }
    else
    {
        throw new IllegalArgumentException();
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-core,代碼行數:35,代碼來源:JMXUtils.java

示例3: getTypeForName

private static SimpleType<?> getTypeForName(String name) {
    switch (name) {
		case "boolean":
		case "java.lang.Boolean": return SimpleType.BOOLEAN;
		case "byte":
		case "java.lang.Byte": return SimpleType.BYTE;
  		case "char":
  		case "java.lang.Character": return SimpleType.CHARACTER;
  		case "double":
    	case "java.lang.Double": return SimpleType.DOUBLE;
    	case "float":
    	case "java.lang.Float": return SimpleType.FLOAT;
    	case "int":
    	case "java.lang.Integer": return SimpleType.INTEGER;
  		case "long":
    	case "java.lang.Long": return SimpleType.LONG;
    	case "short":
    	case "java.lang.Short": return SimpleType.SHORT;
    	case "java.math.BigDecimal": return SimpleType.BIGDECIMAL;
    	case "java.math.BigInteger": return SimpleType.BIGINTEGER;
    	case "java.util.Date": return SimpleType.DATE;
    	case "javax.management.ObjectName": return SimpleType.OBJECTNAME; 
    	case "java.lang.String": return SimpleType.STRING;
        //CompositeData.class.getName(),
        //TabularData.class.getName()
        //}
    }
	return null;
}
 
開發者ID:dsukhoroslov,項目名稱:bagri,代碼行數:29,代碼來源:JMXUtils.java

示例4: getGcInfoCompositeType

synchronized CompositeType getGcInfoCompositeType() {
    if (gcInfoCompositeType != null)
        return gcInfoCompositeType;

    // First, fill with the attributes in the GcInfo
    String[] gcInfoItemNames = GcInfoCompositeData.getBaseGcInfoItemNames();
    OpenType<?>[] gcInfoItemTypes = GcInfoCompositeData.getBaseGcInfoItemTypes();
    int numGcInfoItems = gcInfoItemNames.length;

    int itemCount = numGcInfoItems + gcExtItemCount;
    allItemNames = new String[itemCount];
    String[] allItemDescs = new String[itemCount];
    OpenType<?>[] allItemTypes = new OpenType<?>[itemCount];

    System.arraycopy(gcInfoItemNames, 0, allItemNames, 0, numGcInfoItems);
    System.arraycopy(gcInfoItemNames, 0, allItemDescs, 0, numGcInfoItems);
    System.arraycopy(gcInfoItemTypes, 0, allItemTypes, 0, numGcInfoItems);

    // Then fill with the extension GC-specific attributes, if any.
    if (gcExtItemCount > 0) {
        fillGcAttributeInfo(gc, gcExtItemCount, gcExtItemNames,
                            gcExtItemTypes, gcExtItemDescs);
        System.arraycopy(gcExtItemNames, 0, allItemNames,
                         numGcInfoItems, gcExtItemCount);
        System.arraycopy(gcExtItemDescs, 0, allItemDescs,
                         numGcInfoItems, gcExtItemCount);
        for (int i = numGcInfoItems, j = 0; j < gcExtItemCount; i++, j++) {
            switch (gcExtItemTypes[j]) {
                case 'Z':
                    allItemTypes[i] = SimpleType.BOOLEAN;
                    break;
                case 'B':
                    allItemTypes[i] = SimpleType.BYTE;
                    break;
                case 'C':
                    allItemTypes[i] = SimpleType.CHARACTER;
                    break;
                case 'S':
                    allItemTypes[i] = SimpleType.SHORT;
                    break;
                case 'I':
                    allItemTypes[i] = SimpleType.INTEGER;
                    break;
                case 'J':
                    allItemTypes[i] = SimpleType.LONG;
                    break;
                case 'F':
                    allItemTypes[i] = SimpleType.FLOAT;
                    break;
                case 'D':
                    allItemTypes[i] = SimpleType.DOUBLE;
                    break;
                default:
                    throw new AssertionError(
                        "Unsupported type [" + gcExtItemTypes[i] + "]");
            }
        }
    }

    CompositeType gict = null;
    try {
        final String typeName =
            "sun.management." + gc.getName() + ".GcInfoCompositeType";

        gict = new CompositeType(typeName,
                                 "CompositeType for GC info for " +
                                     gc.getName(),
                                 allItemNames,
                                 allItemDescs,
                                 allItemTypes);
    } catch (OpenDataException e) {
        // shouldn't reach here
        throw new RuntimeException(e);
    }
    gcInfoCompositeType = gict;

    return gcInfoCompositeType;
}
 
開發者ID:campolake,項目名稱:openjdk9,代碼行數:78,代碼來源:GcInfoBuilder.java

示例5: getGcInfoCompositeType

synchronized CompositeType getGcInfoCompositeType() {
    if (gcInfoCompositeType != null)
        return gcInfoCompositeType;

    // First, fill with the attributes in the GcInfo
    String[] gcInfoItemNames = GcInfoCompositeData.getBaseGcInfoItemNames();
    OpenType[] gcInfoItemTypes = GcInfoCompositeData.getBaseGcInfoItemTypes();
    int numGcInfoItems = gcInfoItemNames.length;

    int itemCount = numGcInfoItems + gcExtItemCount;
    allItemNames = new String[itemCount];
    String[] allItemDescs = new String[itemCount];
    OpenType<?>[] allItemTypes = new OpenType<?>[itemCount];

    System.arraycopy(gcInfoItemNames, 0, allItemNames, 0, numGcInfoItems);
    System.arraycopy(gcInfoItemNames, 0, allItemDescs, 0, numGcInfoItems);
    System.arraycopy(gcInfoItemTypes, 0, allItemTypes, 0, numGcInfoItems);

    // Then fill with the extension GC-specific attributes, if any.
    if (gcExtItemCount > 0) {
        fillGcAttributeInfo(gc, gcExtItemCount, gcExtItemNames,
                            gcExtItemTypes, gcExtItemDescs);
        System.arraycopy(gcExtItemNames, 0, allItemNames,
                         numGcInfoItems, gcExtItemCount);
        System.arraycopy(gcExtItemDescs, 0, allItemDescs,
                         numGcInfoItems, gcExtItemCount);
        for (int i = numGcInfoItems, j = 0; j < gcExtItemCount; i++, j++) {
            switch (gcExtItemTypes[j]) {
                case 'Z':
                    allItemTypes[i] = SimpleType.BOOLEAN;
                    break;
                case 'B':
                    allItemTypes[i] = SimpleType.BYTE;
                    break;
                case 'C':
                    allItemTypes[i] = SimpleType.CHARACTER;
                    break;
                case 'S':
                    allItemTypes[i] = SimpleType.SHORT;
                    break;
                case 'I':
                    allItemTypes[i] = SimpleType.INTEGER;
                    break;
                case 'J':
                    allItemTypes[i] = SimpleType.LONG;
                    break;
                case 'F':
                    allItemTypes[i] = SimpleType.FLOAT;
                    break;
                case 'D':
                    allItemTypes[i] = SimpleType.DOUBLE;
                    break;
                default:
                    throw new AssertionError(
                        "Unsupported type [" + gcExtItemTypes[i] + "]");
            }
        }
    }

    CompositeType gict = null;
    try {
        final String typeName =
            "sun.management." + gc.getName() + ".GcInfoCompositeType";

        gict = new CompositeType(typeName,
                                 "CompositeType for GC info for " +
                                     gc.getName(),
                                 allItemNames,
                                 allItemDescs,
                                 allItemTypes);
    } catch (OpenDataException e) {
        // shouldn't reach here
        throw Util.newException(e);
    }
    gcInfoCompositeType = gict;

    return gcInfoCompositeType;
}
 
開發者ID:JetBrains,項目名稱:jdk8u_jdk,代碼行數:78,代碼來源:GcInfoBuilder.java

示例6: getGcInfoCompositeType

synchronized CompositeType getGcInfoCompositeType() {
    if (gcInfoCompositeType != null)
        return gcInfoCompositeType;

    // First, fill with the attributes in the GcInfo
    String[] gcInfoItemNames = GcInfoCompositeData.getBaseGcInfoItemNames();
    OpenType[] gcInfoItemTypes = GcInfoCompositeData.getBaseGcInfoItemTypes();
    int numGcInfoItems = gcInfoItemNames.length;

    int itemCount = numGcInfoItems + gcExtItemCount;
    allItemNames = new String[itemCount];
    String[] allItemDescs = new String[itemCount];
    OpenType[] allItemTypes = new OpenType[itemCount];

    System.arraycopy(gcInfoItemNames, 0, allItemNames, 0, numGcInfoItems);
    System.arraycopy(gcInfoItemNames, 0, allItemDescs, 0, numGcInfoItems);
    System.arraycopy(gcInfoItemTypes, 0, allItemTypes, 0, numGcInfoItems);

    // Then fill with the extension GC-specific attributes, if any.
    if (gcExtItemCount > 0) {
        fillGcAttributeInfo(gc, gcExtItemCount, gcExtItemNames,
                            gcExtItemTypes, gcExtItemDescs);
        System.arraycopy(gcExtItemNames, 0, allItemNames,
                         numGcInfoItems, gcExtItemCount);
        System.arraycopy(gcExtItemDescs, 0, allItemDescs,
                         numGcInfoItems, gcExtItemCount);
        for (int i = numGcInfoItems, j = 0; j < gcExtItemCount; i++, j++) {
            switch (gcExtItemTypes[j]) {
                case 'Z':
                    allItemTypes[i] = SimpleType.BOOLEAN;
                    break;
                case 'B':
                    allItemTypes[i] = SimpleType.BYTE;
                    break;
                case 'C':
                    allItemTypes[i] = SimpleType.CHARACTER;
                    break;
                case 'S':
                    allItemTypes[i] = SimpleType.SHORT;
                    break;
                case 'I':
                    allItemTypes[i] = SimpleType.INTEGER;
                    break;
                case 'J':
                    allItemTypes[i] = SimpleType.LONG;
                    break;
                case 'F':
                    allItemTypes[i] = SimpleType.FLOAT;
                    break;
                case 'D':
                    allItemTypes[i] = SimpleType.DOUBLE;
                    break;
                default:
                    throw new AssertionError(
                        "Unsupported type [" + gcExtItemTypes[i] + "]");
            }
        }
    }

    CompositeType gict = null;
    try {
        final String typeName =
            "sun.management." + gc.getName() + ".GcInfoCompositeType";

        gict = new CompositeType(typeName,
                                 "CompositeType for GC info for " +
                                     gc.getName(),
                                 allItemNames,
                                 allItemDescs,
                                 allItemTypes);
    } catch (OpenDataException e) {
        // shouldn't reach here
        throw Util.newException(e);
    }
    gcInfoCompositeType = gict;

    return gcInfoCompositeType;
}
 
開發者ID:openjdk,項目名稱:jdk7-jdk,代碼行數:78,代碼來源:GcInfoBuilder.java

示例7: getOpenType

private static OpenType getOpenType(Object value) {
    if (value == null) {
        return SimpleType.VOID;
    }
    String name = value.getClass().getName();
    //if (OpenType.ALLOWED_CLASSNAMES_LIST.contains(name)) {

    if ("java.lang.Long".equals(name)) {
        return SimpleType.LONG;
    }
    if ("java.lang.Integer".equals(name)) {
        return SimpleType.INTEGER;
    }
    if ("java.lang.String".equals(name)) {
        return SimpleType.STRING;
    }
    if ("java.lang.Double".equals(name)) {
        return SimpleType.DOUBLE;
    }
    if ("java.lang.Float".equals(name)) {
        return SimpleType.FLOAT;
    }
    if ("java.math.BigDecimal".equals(name)) {
        return SimpleType.BIGDECIMAL;
    }
    if ("java.math.BigInteger".equals(name)) {
        return SimpleType.BIGINTEGER;
    }
    if ("java.lang.Boolean".equals(name)) {
        return SimpleType.BOOLEAN;
    }
    if ("java.lang.Byte".equals(name)) {
        return SimpleType.BYTE;
    }
    if ("java.lang.Character".equals(name)) {
        return SimpleType.CHARACTER;
    }
    if ("java.util.Date".equals(name)) {
        return SimpleType.DATE;
    }
    if ("java.lang.Short".equals(name)) {
        return SimpleType.SHORT;
    }
    //"javax.management.ObjectName",
    //CompositeData.class.getName(),
    //TabularData.class.getName()
    //}
    return null; // is it allowed ??
}
 
開發者ID:dsukhoroslov,項目名稱:bagri,代碼行數:49,代碼來源:ClusterServiceProvider.java


注:本文中的javax.management.openmbean.SimpleType.FLOAT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。