类java.lang.Float源码实例Demo

下面列出了怎么用java.lang.Float的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: j2objc   文件: MaxFloatingPointTest.java
public void testFloatNarrowing() {
  if (System.getProperty("os.arch").equals("armv7")) {
    return;
  }
  float fmin = Float.NEGATIVE_INFINITY;
  float fmax = Float.POSITIVE_INFINITY;
  assertEquals("fmin as long failed", Long.MIN_VALUE, (long) fmin);
  assertEquals("fmax as long failed", Long.MAX_VALUE, (long) fmax);
  assertEquals("fmin as int failed", Integer.MIN_VALUE, (int) fmin);
  assertEquals("fmax as int failed", Integer.MAX_VALUE, (int) fmax);
  assertEquals("fmin as char failed", Character.MIN_VALUE, (char) fmin);
  assertEquals("fmax as char failed", Character.MAX_VALUE, (char) fmax);

  // Surprising values for shorts and bytes, but that's what's specified.
  assertEquals("fmin as short failed", 0, (short) fmin);
  assertEquals("fmax as short failed", -1, (short) fmax);
  assertEquals("fmin as byte failed", 0, (byte) fmin);
  assertEquals("fmax as byte failed", -1, (byte) fmax);
}
 
源代码2 项目: mavlink   文件: SetHomePosition.java
private SetHomePosition(int targetSystem, int latitude, int longitude, int altitude, float x,
        float y, float z, List<Float> q, float approachX, float approachY, float approachZ,
        BigInteger timeUsec) {
    this.targetSystem = targetSystem;
    this.latitude = latitude;
    this.longitude = longitude;
    this.altitude = altitude;
    this.x = x;
    this.y = y;
    this.z = z;
    this.q = q;
    this.approachX = approachX;
    this.approachY = approachY;
    this.approachZ = approachZ;
    this.timeUsec = timeUsec;
}
 
private TrajectoryRepresentationWaypoints(BigInteger timeUsec, int validPoints,
        List<Float> posX, List<Float> posY, List<Float> posZ, List<Float> velX,
        List<Float> velY, List<Float> velZ, List<Float> accX, List<Float> accY,
        List<Float> accZ, List<Float> posYaw, List<Float> velYaw, EnumValue<MavCmd> command) {
    this.timeUsec = timeUsec;
    this.validPoints = validPoints;
    this.posX = posX;
    this.posY = posY;
    this.posZ = posZ;
    this.velX = velX;
    this.velY = velY;
    this.velZ = velZ;
    this.accX = accX;
    this.accY = accY;
    this.accZ = accZ;
    this.posYaw = posYaw;
    this.velYaw = velYaw;
    this.command = command;
}
 
源代码4 项目: mavlink   文件: Odometry.java
private Odometry(BigInteger timeUsec, EnumValue<MavFrame> frameId,
        EnumValue<MavFrame> childFrameId, float x, float y, float z, List<Float> q, float vx,
        float vy, float vz, float rollspeed, float pitchspeed, float yawspeed,
        List<Float> poseCovariance, List<Float> velocityCovariance, int resetCounter,
        EnumValue<MavEstimatorType> estimatorType) {
    this.timeUsec = timeUsec;
    this.frameId = frameId;
    this.childFrameId = childFrameId;
    this.x = x;
    this.y = y;
    this.z = z;
    this.q = q;
    this.vx = vx;
    this.vy = vy;
    this.vz = vz;
    this.rollspeed = rollspeed;
    this.pitchspeed = pitchspeed;
    this.yawspeed = yawspeed;
    this.poseCovariance = poseCovariance;
    this.velocityCovariance = velocityCovariance;
    this.resetCounter = resetCounter;
    this.estimatorType = estimatorType;
}
 
源代码5 项目: SVGAPlayer-Android   文件: ShapeEntity.java
public RGBAColor(Float r, Float g, Float b, Float a, ByteString unknownFields) {
  super(ADAPTER, unknownFields);
  this.r = r;
  this.g = g;
  this.b = b;
  this.a = a;
}
 
源代码6 项目: mavlink   文件: ActuatorControlTarget.java
/**
 * Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation 
 * direction motors is 0..1, negative range for reverse direction. Standard mapping for 
 * attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, 
 * airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs. 
 */
@MavlinkFieldInfo(
        position = 3,
        unitSize = 4,
        arraySize = 8,
        description = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."
)
public final List<Float> controls() {
    return this.controls;
}
 
源代码7 项目: dataenum   文件: PrimitiveValue.java
@Override
public int hashCode() {
  int result = 0;
  result = result * 31 + Integer.valueOf(this.param1).hashCode();
  result = result * 31 + Boolean.valueOf(this.param2).hashCode();
  result = result * 31 + Float.valueOf(this.param3).hashCode();
  return result * 31 + Double.valueOf(this.param4).hashCode();
}
 
源代码8 项目: VideoOS-Android-SDK   文件: Layout.java
public Layout(Float x, Float y, Float width, Float height, ByteString unknownFields) {
  super(ADAPTER, unknownFields);
  this.x = x;
  this.y = y;
  this.width = width;
  this.height = height;
}
 
源代码9 项目: mavlink   文件: VisionPositionDelta.java
/**
 * Change in position from previous to current frame rotated into body frame (0=forward, 
 * 1=right, 2=down). 
 */
@MavlinkFieldInfo(
        position = 4,
        unitSize = 4,
        arraySize = 3,
        description = "Change in position from previous to current frame rotated into body frame (0=forward, 1=right, 2=down)."
)
public final List<Float> positionDelta() {
    return this.positionDelta;
}
 
源代码10 项目: VideoOS-Android-SDK   文件: ShapeEntity.java
public EllipseArgs(Float x, Float y, Float radiusX, Float radiusY, ByteString unknownFields) {
  super(ADAPTER, unknownFields);
  this.x = x;
  this.y = y;
  this.radiusX = radiusX;
  this.radiusY = radiusY;
}
 
源代码11 项目: VideoOS-Android-SDK   文件: ShapeEntity.java
public RGBAColor(Float r, Float g, Float b, Float a, ByteString unknownFields) {
  super(ADAPTER, unknownFields);
  this.r = r;
  this.g = g;
  this.b = b;
  this.a = a;
}
 
/**
 * {@inheritDoc}
 */
@Override
@NonNull
public BoxedTypesPrivateFieldsIgnoreNull mapFromCursor(@NonNull StorIOContentResolver storIOContentResolver, @NonNull Cursor cursor) {

    Boolean field1 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
        field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
    }
    Short field2 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
        field2 = cursor.getShort(cursor.getColumnIndex("field2"));
    }
    Integer field3 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
        field3 = cursor.getInt(cursor.getColumnIndex("field3"));
    }
    Long field4 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
        field4 = cursor.getLong(cursor.getColumnIndex("field4"));
    }
    Float field5 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
        field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
    }
    Double field6 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
        field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
    }

    BoxedTypesPrivateFieldsIgnoreNull object = new BoxedTypesPrivateFieldsIgnoreNull(field1, field2, field3, field4, field5, field6);

    return object;
}
 
源代码13 项目: mavlink   文件: HomePosition.java
private HomePosition(int latitude, int longitude, int altitude, float x, float y, float z,
        List<Float> q, float approachX, float approachY, float approachZ, BigInteger timeUsec) {
    this.latitude = latitude;
    this.longitude = longitude;
    this.altitude = altitude;
    this.x = x;
    this.y = y;
    this.z = z;
    this.q = q;
    this.approachX = approachX;
    this.approachY = approachY;
    this.approachZ = approachZ;
    this.timeUsec = timeUsec;
}
 
源代码14 项目: mavlink   文件: AttPosMocap.java
private AttPosMocap(BigInteger timeUsec, List<Float> q, float x, float y, float z,
        List<Float> covariance) {
    this.timeUsec = timeUsec;
    this.q = q;
    this.x = x;
    this.y = y;
    this.z = z;
    this.covariance = covariance;
}
 
源代码15 项目: mavlink   文件: AttPosMocap.java
/**
 * Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) 
 */
@MavlinkFieldInfo(
        position = 2,
        unitSize = 4,
        arraySize = 4,
        description = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"
)
public final List<Float> q() {
    return this.q;
}
 
源代码16 项目: mavlink   文件: AttPosMocap.java
/**
 * Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle 
 * (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the 
 * second ROW, etc.). If unknown, assign NaN value to first element in the array. 
 */
@MavlinkFieldInfo(
        position = 7,
        unitSize = 4,
        arraySize = 21,
        extension = true,
        description = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."
)
public final List<Float> covariance() {
    return this.covariance;
}
 
源代码17 项目: mavlink   文件: SetHomePosition.java
/**
 * World to surface normal and heading transformation of the takeoff position. Used to indicate 
 * the heading and slope of the ground 
 */
@MavlinkFieldInfo(
        position = 8,
        unitSize = 4,
        arraySize = 4,
        description = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"
)
public final List<Float> q() {
    return this.q;
}
 
源代码18 项目: mavlink   文件: VisionPositionEstimate.java
private VisionPositionEstimate(BigInteger usec, float x, float y, float z, float roll,
        float pitch, float yaw, List<Float> covariance, int resetCounter) {
    this.usec = usec;
    this.x = x;
    this.y = y;
    this.z = z;
    this.roll = roll;
    this.pitch = pitch;
    this.yaw = yaw;
    this.covariance = covariance;
    this.resetCounter = resetCounter;
}
 
源代码19 项目: mavlink   文件: VisionPositionEstimate.java
/**
 * Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: 
 * x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second 
 * ROW, etc.). If unknown, assign NaN value to first element in the array. 
 */
@MavlinkFieldInfo(
        position = 9,
        unitSize = 4,
        arraySize = 21,
        extension = true,
        description = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."
)
public final List<Float> covariance() {
    return this.covariance;
}
 
源代码20 项目: mavlink   文件: AttitudeTarget.java
private AttitudeTarget(long timeBootMs, int typeMask, List<Float> q, float bodyRollRate,
        float bodyPitchRate, float bodyYawRate, float thrust) {
    this.timeBootMs = timeBootMs;
    this.typeMask = typeMask;
    this.q = q;
    this.bodyRollRate = bodyRollRate;
    this.bodyPitchRate = bodyPitchRate;
    this.bodyYawRate = bodyYawRate;
    this.thrust = thrust;
}
 
源代码21 项目: mavlink   文件: AttitudeTarget.java
/**
 * Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) 
 */
@MavlinkFieldInfo(
        position = 3,
        unitSize = 4,
        arraySize = 4,
        description = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"
)
public final List<Float> q() {
    return this.q;
}
 
源代码22 项目: mavlink   文件: TrajectoryRepresentationBezier.java
/**
 * X-coordinate of starting bezier point, set to NaN if not being used 
 */
@MavlinkFieldInfo(
        position = 4,
        unitSize = 4,
        arraySize = 5,
        description = "X-coordinate of starting bezier point, set to NaN if not being used"
)
public final List<Float> posX() {
    return this.posX;
}
 
源代码23 项目: mavlink   文件: TrajectoryRepresentationBezier.java
/**
 * Y-coordinate of starting bezier point, set to NaN if not being used 
 */
@MavlinkFieldInfo(
        position = 5,
        unitSize = 4,
        arraySize = 5,
        description = "Y-coordinate of starting bezier point, set to NaN if not being used"
)
public final List<Float> posY() {
    return this.posY;
}
 
源代码24 项目: mavlink   文件: TrajectoryRepresentationBezier.java
/**
 * Z-coordinate of starting bezier point, set to NaN if not being used 
 */
@MavlinkFieldInfo(
        position = 6,
        unitSize = 4,
        arraySize = 5,
        description = "Z-coordinate of starting bezier point, set to NaN if not being used"
)
public final List<Float> posZ() {
    return this.posZ;
}
 
/**
 * Y-acceleration of waypoint, set to NaN if not being used 
 */
@MavlinkFieldInfo(
        position = 11,
        unitSize = 4,
        arraySize = 5,
        description = "Y-acceleration of waypoint, set to NaN if not being used"
)
public final List<Float> accY() {
    return this.accY;
}
 
/**
 * {@inheritDoc}
 */
@Override
@NonNull
public BoxedTypesPrivateFieldsIgnoreNull mapFromCursor(@NonNull StorIOSQLite storIOSQLite, @NonNull Cursor cursor) {

    Boolean field1 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field1"))) {
        field1 = cursor.getInt(cursor.getColumnIndex("field1")) == 1;
    }
    Short field2 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field2"))) {
        field2 = cursor.getShort(cursor.getColumnIndex("field2"));
    }
    Integer field3 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field3"))) {
        field3 = cursor.getInt(cursor.getColumnIndex("field3"));
    }
    Long field4 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field4"))) {
        field4 = cursor.getLong(cursor.getColumnIndex("field4"));
    }
    Float field5 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field5"))) {
        field5 = cursor.getFloat(cursor.getColumnIndex("field5"));
    }
    Double field6 = null;
    if (!cursor.isNull(cursor.getColumnIndex("field6"))) {
        field6 = cursor.getDouble(cursor.getColumnIndex("field6"));
    }

    BoxedTypesPrivateFieldsIgnoreNull object = new BoxedTypesPrivateFieldsIgnoreNull(field1, field2, field3, field4, field5, field6);

    return object;
}
 
源代码27 项目: mavlink   文件: GlobalVisionPositionEstimate.java
private GlobalVisionPositionEstimate(BigInteger usec, float x, float y, float z, float roll,
        float pitch, float yaw, List<Float> covariance, int resetCounter) {
    this.usec = usec;
    this.x = x;
    this.y = y;
    this.z = z;
    this.roll = roll;
    this.pitch = pitch;
    this.yaw = yaw;
    this.covariance = covariance;
    this.resetCounter = resetCounter;
}
 
源代码28 项目: mavlink   文件: GlobalVisionPositionEstimate.java
/**
 * Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: 
 * x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five 
 * entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array. 
 */
@MavlinkFieldInfo(
        position = 9,
        unitSize = 4,
        arraySize = 21,
        extension = true,
        description = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."
)
public final List<Float> covariance() {
    return this.covariance;
}
 
源代码29 项目: mavlink   文件: AttitudeQuaternionCov.java
private AttitudeQuaternionCov(BigInteger timeUsec, List<Float> q, float rollspeed,
        float pitchspeed, float yawspeed, List<Float> covariance) {
    this.timeUsec = timeUsec;
    this.q = q;
    this.rollspeed = rollspeed;
    this.pitchspeed = pitchspeed;
    this.yawspeed = yawspeed;
    this.covariance = covariance;
}
 
源代码30 项目: mavlink   文件: AttitudeQuaternionCov.java
/**
 * Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; 
 * first three entries are the first ROW, next three entries are the second row, etc.). If unknown, 
 * assign NaN value to first element in the array. 
 */
@MavlinkFieldInfo(
        position = 6,
        unitSize = 4,
        arraySize = 9,
        description = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."
)
public final List<Float> covariance() {
    return this.covariance;
}
 
 类所在包
 同包方法