public class Criteria extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static int |
ACCURACY_COARSE
A constant indicating an approximate accuracy requirement
|
static int |
ACCURACY_FINE
A constant indicating a finer location accuracy requirement
|
static int |
ACCURACY_HIGH
a constant indicating a high accuracy requirement
- may be used for horizontal, altitude, speed or bearing accuracy.
|
static int |
ACCURACY_LOW
A constant indicating a low location accuracy requirement
- may be used for horizontal, altitude, speed or bearing accuracy.
|
static int |
ACCURACY_MEDIUM
A constant indicating a medium accuracy requirement
- currently used only for horizontal accuracy.
|
static Parcelable.Creator<Criteria> |
CREATOR |
static int |
NO_REQUIREMENT
A constant indicating that the application does not choose to
place requirement on a particular feature.
|
static int |
POWER_HIGH
A constant indicating a high power requirement.
|
static int |
POWER_LOW
A constant indicating a low power requirement.
|
static int |
POWER_MEDIUM
A constant indicating a medium power requirement.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
Criteria()
Constructs a new Criteria object.
|
Criteria(Criteria criteria)
Constructs a new Criteria object that is a copy of the given criteria.
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
int |
getAccuracy()
Returns a constant indicating desired accuracy of location
Accuracy may be
ACCURACY_FINE if desired location
is fine, else it can be ACCURACY_COARSE . |
int |
getBearingAccuracy()
Returns a constant indicating the desired bearing accuracy.
|
int |
getHorizontalAccuracy()
Returns a constant indicating the desired horizontal accuracy (latitude and longitude).
|
int |
getPowerRequirement()
Returns a constant indicating the desired power requirement.
|
int |
getSpeedAccuracy()
Returns a constant indicating the desired speed accuracy
Accuracy may be
ACCURACY_LOW , ACCURACY_HIGH ,
or NO_REQUIREMENT . |
int |
getVerticalAccuracy()
Returns a constant indicating the desired vertical accuracy (altitude).
|
boolean |
isAltitudeRequired()
Returns whether the provider must provide altitude information.
|
boolean |
isBearingRequired()
Returns whether the provider must provide bearing information.
|
boolean |
isCostAllowed()
Returns whether the provider is allowed to incur monetary cost.
|
boolean |
isSpeedRequired()
Returns whether the provider must provide speed information.
|
void |
setAccuracy(int accuracy)
Indicates the desired accuracy for latitude and longitude.
|
void |
setAltitudeRequired(boolean altitudeRequired)
Indicates whether the provider must provide altitude information.
|
void |
setBearingAccuracy(int accuracy)
Indicates the desired bearing accuracy.
|
void |
setBearingRequired(boolean bearingRequired)
Indicates whether the provider must provide bearing information.
|
void |
setCostAllowed(boolean costAllowed)
Indicates whether the provider is allowed to incur monetary cost.
|
void |
setHorizontalAccuracy(int accuracy)
Indicates the desired horizontal accuracy (latitude and longitude).
|
void |
setPowerRequirement(int level)
Indicates the desired maximum power level.
|
void |
setSpeedAccuracy(int accuracy)
Indicates the desired speed accuracy.
|
void |
setSpeedRequired(boolean speedRequired)
Indicates whether the provider must provide speed information.
|
void |
setVerticalAccuracy(int accuracy)
Indicates the desired vertical accuracy (altitude).
|
String |
toString()
Returns a string representation of the object.
|
void |
writeToParcel(Parcel parcel,
int flags)
Flatten this object in to a Parcel.
|
public static final int NO_REQUIREMENT
public static final int POWER_LOW
public static final int POWER_MEDIUM
public static final int POWER_HIGH
public static final int ACCURACY_FINE
public static final int ACCURACY_COARSE
public static final int ACCURACY_LOW
public static final int ACCURACY_MEDIUM
public static final int ACCURACY_HIGH
public static final Parcelable.Creator<Criteria> CREATOR
public Criteria()
public Criteria(Criteria criteria)
public void setHorizontalAccuracy(int accuracy)
ACCURACY_LOW
, ACCURACY_MEDIUM
,
ACCURACY_HIGH
or NO_REQUIREMENT
.
More accurate location may consume more power and may take longer.IllegalArgumentException
- if accuracy is not one of the supported constantspublic int getHorizontalAccuracy()
ACCURACY_LOW
, ACCURACY_MEDIUM
,
ACCURACY_HIGH
or NO_REQUIREMENT
.public void setVerticalAccuracy(int accuracy)
ACCURACY_LOW
, ACCURACY_MEDIUM
,
ACCURACY_HIGH
or NO_REQUIREMENT
.
More accurate location may consume more power and may take longer.IllegalArgumentException
- if accuracy is not one of the supported constantspublic int getVerticalAccuracy()
ACCURACY_LOW
, ACCURACY_HIGH
,
or NO_REQUIREMENT
.public void setSpeedAccuracy(int accuracy)
ACCURACY_LOW
, ACCURACY_HIGH
,
or NO_REQUIREMENT
.
More accurate location may consume more power and may take longer.IllegalArgumentException
- if accuracy is not one of the supported constantspublic int getSpeedAccuracy()
ACCURACY_LOW
, ACCURACY_HIGH
,
or NO_REQUIREMENT
.public void setBearingAccuracy(int accuracy)
ACCURACY_LOW
, ACCURACY_HIGH
,
or NO_REQUIREMENT
.
More accurate location may consume more power and may take longer.IllegalArgumentException
- if accuracy is not one of the supported constantspublic int getBearingAccuracy()
ACCURACY_LOW
, ACCURACY_HIGH
,
or NO_REQUIREMENT
.public void setAccuracy(int accuracy)
ACCURACY_FINE
if desired location
is fine, else it can be ACCURACY_COARSE
.
More accurate location may consume more power and may take longer.IllegalArgumentException
- if accuracy is not one of the supported constantspublic int getAccuracy()
ACCURACY_FINE
if desired location
is fine, else it can be ACCURACY_COARSE
.public void setPowerRequirement(int level)
public int getPowerRequirement()
public void setCostAllowed(boolean costAllowed)
public boolean isCostAllowed()
public void setAltitudeRequired(boolean altitudeRequired)
public boolean isAltitudeRequired()
public void setSpeedRequired(boolean speedRequired)
public boolean isSpeedRequired()
public void setBearingRequired(boolean bearingRequired)
public boolean isBearingRequired()
public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void writeToParcel(Parcel parcel, int flags)
Parcelable
writeToParcel
in interface Parcelable
parcel
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())