/** * Returns the Object value as a float. If the value is <code>null</code> or * not convertible to a float, the {@link #DEFAULT_FLOAT} is returned. * * @param value the value to convert * @return the value as a float */ public static float getFloat(Object value) { return getFloat(value, DEFAULT_FLOAT); }
return GetterUtil.getFloat(attribute[0]);
/** * Returns the String value as a float. If the value is <code>null</code> or * not convertible to a float, the {@link #DEFAULT_FLOAT} is returned. * * @param value the value to convert * @return the value as a float */ public static float getFloat(String value) { return getFloat(value, DEFAULT_FLOAT); }
return GetterUtil.getFloat(attribute);
public float getFloat(java.lang.String value) { return GetterUtil.getFloat(value); }
public float getFloat(java.lang.String value, float defaultValue) { return GetterUtil.getFloat(value, defaultValue); }
public float getFloat(java.lang.Object value, float defaultValue) { return GetterUtil.getFloat(value, defaultValue); }
public float getFloat(java.lang.Object value) { return GetterUtil.getFloat(value); }
/** * Returns the request parameter value as a float. If the parameter is * missing or not convertible to a float, <code>0</code> is returned. * * @param request the servlet request from which to read the parameter * @param param the name of the parameter * @return the request parameter value as a float */ public static float getFloat(HttpServletRequest request, String param) { return GetterUtil.getFloat(request.getParameter(param)); }
/** * Returns the String values as a float array. If the values array is * <code>null</code>, the {@link #DEFAULT_FLOAT_VALUES} array is returned. * In the returned array, each value element not convertible to a float is * replaced by the default value. * * @param values the values to convert * @param defaultValue a default value * @return the values as a float array */ public static float[] getFloatValues( String[] values, float[] defaultValue) { if (values == null) { return defaultValue; } float[] floatValues = new float[values.length]; for (int i = 0; i < values.length; i++) { floatValues[i] = getFloat(values[i]); } return floatValues; }
/** * Returns the portlet request parameter value as a float. If the parameter * is missing or not convertible to a float, <code>0</code> is returned. * * @param portletRequest the portlet request from which to read the * parameter * @param param the name of the parameter * @return the portlet request parameter value as a float */ public static float getFloat(PortletRequest portletRequest, String param) { return GetterUtil.getFloat(portletRequest.getParameter(param)); }
public DictionaryEntry(String line) { String[] values = StringUtil.split(line, StringPool.SPACE); _word = values[0]; if (values.length == 2) { _weight = GetterUtil.getFloat(values[1]); } else { _weight = 0; } }
/** * Returns the service context parameter value as a float. If the parameter * is missing or not convertible to a float, <code>0</code> is returned. * * @param serviceContext the service context from which to read the * parameter * @param param the name of the parameter * @return the service context parameter value as a float */ public static float getFloat(ServiceContext serviceContext, String param) { return GetterUtil.getFloat(serviceContext.getAttribute(param)); }
public float getFloatValue(String key, float defaultValue) { String value = getValue(key, null); return GetterUtil.getFloat(value, defaultValue); }
private Object _getTypedValue(String value) { if (this == Type.BOOLEAN) { return GetterUtil.getBoolean(value); } else if (this == Type.BYTE) { Byte byteValue = Byte.valueOf(value); return byteValue.byteValue(); } else if (this == Type.CHARACTER) { return value.charAt(0); } else if (this == Type.DOUBLE) { return GetterUtil.getDouble(value); } else if (this == Type.FLOAT) { return GetterUtil.getFloat(value); } else if (this == Type.INTEGER) { return GetterUtil.getInteger(value); } else if (this == Type.LONG) { return GetterUtil.getLong(value); } else if (this == Type.SHORT) { return GetterUtil.getShort(value); } return value; }
public static float[] getFloatValues( String[] values, float[] defaultValue) { if (values == null) { return defaultValue; } float[] floatValues = new float[values.length]; for (int i = 0; i < values.length; i++) { floatValues[i] = getFloat(values[i]); } return floatValues; }
float majorVersion = GetterUtil.getFloat(version);
@Activate @Modified protected void activate(Map<String, Object> properties) { _exactMatchBoost = GetterUtil.getFloat( properties.get("exact.match.boost"), _exactMatchBoost); }
@Activate @Modified protected void activate(Map<String, Object> properties) { _exactMatchBoost = GetterUtil.getFloat( properties.get("exact.match.boost"), _exactMatchBoost); _proximitySlop = GetterUtil.getInteger( properties.get("proximity.slop"), _proximitySlop); }