Examples of FixedPoint


Examples of bm.core.math.FixedPoint

                 *47          the checksum data, always begins with
        */
        try
        {
            final byte oldLatitudeDegree = latitudeDegree;
            final FixedPoint oldLatitudeMinutes = latitudeMinutes.clone();
            final char oldLatitude = latitude;
            final byte oldLongitudeDegree = longitudeDegree;
            final FixedPoint oldLongitudeMinutes = longitudeMinutes.clone();
            final char oldLongitude = longitude;
            final short oldQuality = quality;
            final short oldSatellites = satellites;
            final FixedPoint oldAltitude = altitude.clone();

            final StringTokenizer stk = new StringTokenizer( command, "," );
            stk.nextToken(); // Skip GPGGA
            stk.nextToken(); // Skip time
            parseGpsLatitude( stk.nextToken() );
            latitude = stk.nextToken().charAt( 0 );
            parseGpsLongitude( stk.nextToken() );
            longitude = stk.nextToken().charAt( 0 );
            quality = Short.parseShort( stk.nextToken() );
            satellites = Short.parseShort( stk.nextToken() );
            stk.nextToken(); // Skip dilution
            altitude = FixedPoint.parse( stk.nextToken(), '.' );

            final boolean changed =
                    oldLatitude != latitude ||
                    oldLatitudeDegree != latitudeDegree ||
                    !oldLatitudeMinutes.equals( latitudeMinutes ) ||
                    oldLongitude != longitude ||
                    oldLongitudeDegree != longitudeDegree ||
                    !oldLongitudeMinutes.equals( longitudeMinutes ) ||
                    oldQuality != quality ||
                    oldSatellites != satellites ||
                    !oldAltitude.equals( altitude );
            if( changed )
            {
                timestamp.setTime( System.currentTimeMillis() );
            }
            return changed;
View Full Code Here

Examples of bm.core.math.FixedPoint

                       0 :
                       long1 < long2 ? -1 : 1;
            }
            else if( value1 instanceof FixedPoint )
            {
                final FixedPoint fp1 = (FixedPoint) value1;
                final FixedPoint fp2 = (FixedPoint) value2;
                result = fp1.compareTo( fp2 );
            }
            else
            {
                result = value1.toString().compareTo( value2.toString() );
View Full Code Here

Examples of bm.core.math.FixedPoint

                        );
                    }
                }
                else if( value instanceof Long )
                {
                    return new FixedPoint( ((Long) value).longValue() );
                }
                else if( value instanceof Integer )
                {
                    return new FixedPoint( ((Integer) value).longValue() );
                }
                else if( value instanceof Short )
                {
                    return new FixedPoint( ((Short) value).shortValue() );
                }
                else
                {
                    throw new InvalidDataTypeException(
                            Constants.ERR_ROW_CHECK_TYPE,
View Full Code Here

Examples of bm.core.math.FixedPoint

        helpView.show();
    }

    private String sizeIn( final long size, final int divisor )
    {
        FixedPoint f = new FixedPoint( size );
        f = f.setPrecision( 5 );
        f = f.div( divisor );
        f = f.setPrecision( 1 );
        return f.toString();
    }
View Full Code Here

Examples of bm.core.math.FixedPoint

        {
            return (FixedPoint) o;
        }
        else if( o instanceof Long )
        {
            return new FixedPoint( ((Long) o).longValue() );
        }
        else if( o instanceof Integer )
        {
            return new FixedPoint( ((Integer)o).intValue() );
        }
        else if( o instanceof Short )
        {
            return new FixedPoint( ((Short)o).shortValue() );
        }
        else if( o instanceof Byte )
        {
            return new FixedPoint( ((Byte)o).byteValue() );
        }
        else if( o instanceof Boolean )
        {
            return ((Boolean)o).booleanValue() ? FixedPoint.ONE : FixedPoint.ZERO;
        }
View Full Code Here

Examples of bm.core.math.FixedPoint

        helpView.show();
    }

    private String sizeIn( final long size, final int divisor )
    {
        FixedPoint f = new FixedPoint( size );
        f = f.setPrecision( 5 );
        f = f.div( divisor );
        f = f.setPrecision( 1 );
        return f.toString();
    }
View Full Code Here

Examples of org.apache.sqoop.schema.type.FixedPoint

        break;
      case ENUM:
        output = new Enum(key);
        break;
      case FIXED_POINT:
        output = new FixedPoint().setByteSize(size).setUnsigned(unsigned);
        break;
      case FLOATING_POINT:
        output = new FloatingPoint().setByteSize(size);
        break;
      case MAP:
View Full Code Here

Examples of org.apache.sqoop.schema.type.FixedPoint

   * @param name Name that should be used for the generated schema.
   * @return
   */
  public Schema getSchema(String name) {
    return new Schema(name)
      .addColumn(new FixedPoint("ICOL"))
      .addColumn(new FloatingPoint("DCOL"))
      .addColumn(new Text("VCOL"))
    ;
  }
View Full Code Here

Examples of org.apache.sqoop.schema.type.FixedPoint

  public static Column sqlTypeToAbstractType(int sqlType) {
    switch (sqlType) {
      case Types.SMALLINT:
      case Types.TINYINT:
      case Types.INTEGER:
        return new FixedPoint();

      case Types.VARCHAR:
      case Types.CHAR:
      case Types.LONGVARCHAR:
      case Types.NVARCHAR:
View Full Code Here

Examples of org.apache.sqoop.schema.type.FixedPoint

    transferAndAssert(e);
  }

  @Test
  public void testFixedPoint() {
    Schema f = new Schema("f").addColumn(new FixedPoint("fp", 4L, Boolean.FALSE));
    transferAndAssert(f);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.