FileDocCategorySizeDatePackage
GpsMeasurementsEvent.javaAPI DocAndroid 5.1 API5057Thu Mar 12 22:22:30 GMT 2015android.location

GpsMeasurementsEvent

public class GpsMeasurementsEvent extends Object implements android.os.Parcelable
A class implementing a container for data associated with a measurement event. Events are delivered to registered instances of {@link Listener}.
hide

Fields Summary
public static final int
STATUS_NOT_SUPPORTED
The system does not support tracking of GPS Measurements. This status will not change in the future.
public static final int
STATUS_READY
GPS Measurements are successfully being tracked, it will receive updates once they are available.
public static final int
STATUS_GPS_LOCATION_DISABLED
GPS provider or Location is disabled, updates will not be received until they are enabled.
private final GpsClock
mClock
private final Collection
mReadOnlyMeasurements
public static final Creator
CREATOR
Constructors Summary
public GpsMeasurementsEvent(GpsClock clock, GpsMeasurement[] measurements)


                                       
    
       

                       
          

                          
          
    

         
        if (clock == null) {
            throw new InvalidParameterException("Parameter 'clock' must not be null.");
        }
        if (measurements == null || measurements.length == 0) {
            throw new InvalidParameterException(
                    "Parameter 'measurements' must not be null or empty.");
        }

        mClock = clock;
        Collection<GpsMeasurement> measurementCollection = Arrays.asList(measurements);
        mReadOnlyMeasurements = Collections.unmodifiableCollection(measurementCollection);
    
Methods Summary
public intdescribeContents()


    
       
        return 0;
    
public GpsClockgetClock()

        return mClock;
    
public java.util.CollectiongetMeasurements()
Gets a read-only collection of measurements associated with the current event.

        return mReadOnlyMeasurements;
    
public java.lang.StringtoString()

        StringBuilder builder = new StringBuilder("[ GpsMeasurementsEvent:\n\n");

        builder.append(mClock.toString());
        builder.append("\n");

        for (GpsMeasurement measurement : mReadOnlyMeasurements) {
            builder.append(measurement.toString());
            builder.append("\n");
        }

        builder.append("]");

        return builder.toString();
    
public voidwriteToParcel(android.os.Parcel parcel, int flags)

        parcel.writeParcelable(mClock, flags);

        int measurementsCount = mReadOnlyMeasurements.size();
        GpsMeasurement[] measurementsArray =
                mReadOnlyMeasurements.toArray(new GpsMeasurement[measurementsCount]);
        parcel.writeInt(measurementsArray.length);
        parcel.writeTypedArray(measurementsArray, flags);