public float get(Object object) { try { return this.field.getFloat(object); } catch (Exception e) { return 0; } }
/** * Gets the value of a static <code>float</code> field. * * @param field Field object whose value is returned. * @return the value of the <code>float</code> field */ public static float getFloat(Field field) { checkStatic(field); try { return field.getFloat(null); } catch (Exception exp) { throw translate(exp); } }
public float getReflectF() throws Exception { return f_f.getFloat(t); }
/** * Gets the value of an instance <code>float</code> field. * * @param field Field object whose value is returned. * @param obj the object to extract the <code>float</code> value * from * @return the value of the <code>float</code> field */ public static float getFloat(Field field, Object obj) { try { return field.getFloat(obj); } catch (Exception exp) { throw translate(exp); } }
public float getFloat(Object o) throws IllegalArgumentException, IllegalAccessException { return this.field.getFloat(o); }
public final float getFloatValue(Object obj) throws IllegalAccessException { if (!isAndroid && memOffset >= 0) { return FSTUtil.unFlaggedUnsafe.getFloat(obj, memOffset); } return field.getFloat(obj); }
public static float callSetFloat(Field thiz, Object obj) throws IllegalArgumentException, IllegalAccessException { thiz.setFloat(obj, (float) 1.234); return thiz.getFloat(obj); }
private double getDouble(Object object, Class<?> fieldType, Class<?> expectedType) { if (fieldType == Double.TYPE) { return getD(object, field); } return getFloat(object, fieldType, expectedType); }
public final float getFloatValue(Object obj) throws IllegalAccessException { if (!isAndroid && memOffset >= 0) { return FSTUtil.unFlaggedUnsafe.getFloat(obj, memOffset); } return field.getFloat(obj); }
@Override public String toString() { Field[] fields = getFields(this); String r=""; for( Field field : fields ){ String name = field.getName(); Class cl = field.getType(); try{ if( cl.isPrimitive() ){ if( cl == Boolean.TYPE ){ boolean curval = field.getBoolean(this); if( curval ) r += " -"+name; } else if( cl == Integer.TYPE ) r+=" -"+name+"="+field.getInt(this); else if( cl == Float.TYPE ) r+=" -"+name+"="+field.getFloat(this); else if( cl == Double.TYPE ) r+=" -"+name+"="+field.getDouble(this); else if( cl == Long.TYPE ) r+=" -"+name+"="+field.getLong(this); else continue; } else if( cl == String.class ) if (field.get(this)!=null) r+=" -"+name+"="+field.get(this); } catch( Exception e ) { Log.err("Argument failed with ",e); } } return r; } }
rep.append(joiner).append(name).append('=').append(val); } else if (type.equals(float.class)) { float val = ff.getFloat(this); rep.append(joiner).append(name).append('=').append(val); } else if (type.equals(Byte.class)) {
/** * Returns the value of the field in the specified object as a {@code float}. * This reproduces the effect of {@code object.fieldName} * <p> * If this field is static, the object argument is ignored. * Otherwise, if the object is {@code null}, a NullPointerException is * thrown. If the object is not an instance of the declaring class of the * method, an IllegalArgumentException is thrown. * <p> * If this Field object is enforcing access control (see AccessibleObject) * and this field is not accessible from the current context, an * IllegalAccessException is thrown. * * @param object * the object to access * @return the field value * @throws NullPointerException * if the object is {@code null} and the field is non-static * @throws IllegalArgumentException * if the object is not compatible with the declaring class * @throws IllegalAccessException * if this field is not accessible */ public float getFloat(Object object) throws IllegalAccessException, IllegalArgumentException { checkAccess(object, false); checkReceiver(object); return getFloat(object, getType(), Float.TYPE); }
output.writeDouble(field.getDouble(obj)); } else if (type == float.class) { output.writeFloat(field.getFloat(obj)); } else if (type == int.class) { output.writeInt(field.getInt(obj));
@Override public float getFloat( Object obj ) { try { return field.getFloat( obj ); } catch ( Exception e ) { analyzeError( e, obj ); return 0; } }
private double getDouble(Object object, Class<?> fieldType, Class<?> expectedType) { if (fieldType == Double.TYPE) { return getD(object, field); } return getFloat(object, fieldType, expectedType); }
@Override public float getFloat( Object obj ) { try { return field.getFloat( obj ); } catch ( Exception e ) { analyzeError( e, obj ); return 0; } }
public void copy (Object original, Object copy) { try { field.setFloat(copy, field.getFloat(original)); } catch (Exception e) { KryoException ex = new KryoException(e); ex.addTrace(this + " (" + type.getName() + ")"); throw ex; } } }
public void write (Output output, Object object) { try { output.writeFloat(field.getFloat(object)); } catch (Exception e) { KryoException ex = new KryoException(e); ex.addTrace(this + " (" + type.getName() + ")"); throw ex; } }
public void write (Output output, Object object) { try { output.writeFloat(field.getFloat(object)); } catch (Exception e) { KryoException ex = new KryoException(e); ex.addTrace(this + " (" + type.getName() + ")"); throw ex; } }