/** * Creates a primitive list based on an input list and a property path * * @param inputList input list * @param propertyPath property path * @return primitive list */ public static FloatList toFloatList(Collection<?> inputList, String propertyPath) { if (inputList.size() == 0) { return new FloatList(0); } FloatList outputList = new FloatList(inputList.size()); if (propertyPath.contains(".") || propertyPath.contains("[")) { String[] properties = StringScanner.splitByDelimiters(propertyPath, ".[]"); for (Object o : inputList) { outputList.add(BeanUtils.getPropertyFloat(o, properties)); } } else { Map<String, FieldAccess> fields = BeanUtils.getFieldsFromObject(inputList.iterator().next()); FieldAccess fieldAccess = fields.get(propertyPath); for (Object o : inputList) { outputList.add(fieldAccess.getFloat(o)); } } return outputList; }
public static float getPropertyFloat( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toFloat(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.flt ) { return field.getFloat( object ); } else { return Conversions.toFloat( field.getValue( object ) ); } }
public static float getPropertyFloat( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toFloat(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.flt ) { return field.getFloat( object ); } else { return Conversions.toFloat( field.getValue( object ) ); } }
float fvalue = fieldAccess.getFloat ( parent ); if (includeDefault || include || fvalue != 0.0f ) { serializeFieldName ( fieldName, builder );
float fvalue = fieldAccess.getFloat ( parent ); if (includeDefault || include || fvalue != 0.0f ) { serializeFieldName ( fieldName, builder );
float fvalue = fieldAccess.getFloat ( parent ); if ( fvalue != 0 ) { serializeFieldName ( fieldName, builder );
float fvalue = fieldAccess.getFloat ( parent ); if (includeDefault || include || fvalue != 0.0f ) { serializeFieldName ( fieldName, builder );
float fvalue = fieldAccess.getFloat ( parent ); if ( fvalue != 0 ) { serializeFieldName ( fieldName, builder );
float fvalue = fieldAccess.getFloat ( parent ); if ( fvalue != 0 ) { serializeFieldName ( fieldName, builder );
float fvalue = fieldAccess.getFloat ( parent ); if ( fvalue != 0 ) { serializeFieldName ( fieldName, builder );
float fvalue = fieldAccess.getFloat ( parent ); if ( fvalue != 0 ) { serializeFieldName ( fieldName, builder );
float fvalue = fieldAccess.getFloat ( parent ); if ( fvalue != 0 ) { serializeFieldName ( fieldName, builder );