目录

class info
public class Situation implements Parcelable
当前天气信息。包括天气ID(CN)、湿度、摄氏度、华氏度、体感温度(℃)、体感温度(℉)、风向、风力等级、风速、气压、紫外线强度、更新时间。

Public Method Summary

Return typeMethod name
intgetCnWeatherId()
StringgetHumidity()
longgetTemperatureC()
longgetTemperatureF()
longgetRealFeelC()
longgetRealFeelF()
StringgetWindDir()
intgetWindLevel()
intgetWindSpeed()
longgetUpdateTime()
longgetPressure()
intgetUxIndex()

Public Methods

Method
public int getCnWeatherId()
获取CN天气Id(cnWeatherId)。CN天气Id表示的是当前的天气,每个值都对应不同的天气,例如0表示晴,1表示多云,7表示小雨。更多天气ID对应的天气信息请参见CNWeatherId。

Return

Typedesc
intCN天气Id。
Method
public String getHumidity()
获取空气湿度值,百分制。

Return

Typedesc
Stringhumidity,湿度,百分制。
Method
public long getTemperatureC()
获取当前温度,单位:摄氏度。

Return

Typedesc
long当前温度,单位:摄氏度。
Method
public long getTemperatureF()
获取当前温度,单位:华氏度。

Return

Typedesc
long当前温度,单位:华氏度。
Method
public long getRealFeelC()
获取体感温度,单位:摄氏度。

Return

Typedesc
long体感温度,单位:摄氏度。
Method
public long getRealFeelF()
获取体感温度,单位:华氏度。

Return

Typedesc
long体感温度,单位:华氏度。
Method
public String getWindDir()
获取风向,风向值有“NE(东北风向)”、“E(东风向)”、“SE(东南风向)”、“S(南风向)”、“SW(西南风向)”、“W(西风向)”、“N(北风向)”和“NW(西北风向)”八个值。

Return

Typedesc
String风向,风向值有“NE(东北风向)”、“E(东风向)”、“SE(东南风向)”、“S(南风向)”、“SW(西南风向)”、“W(西风向)”、“N(北风向)”和“NW(西北风向)”八个值。
Method
public int getWindLevel()
获取风级。风级,实时天气的风级,值区间为0~17,0表示微风。

Return

Typedesc
int风级,实时天气的风级,值区间为0~17,0表示微风。
Method
public int getWindSpeed()
获取风速,单位:km/h。

Return

Typedesc
long风速,单位:km/h。
Method
public long getUpdateTime()
当前天气的发布时间。

Return

Typedesc
long时间戳,此时天气的发布时间。
Method
public long getPressure()
获取气压,单位:百帕。

Return

Typedesc
long气压,单位:百帕。
Method
public int getUxIndex()
获取当前紫外线强度,紫外线等级划分请参见WeatherStatus。

Return

Typedesc
int紫外线强度。