Package bm.core.math

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


                       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

                        );
                    }
                }
                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

        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

        {
            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

        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

TOP

Related Classes of bm.core.math.FixedPoint

Copyright © 2018 www.massapicom. 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.