Java Reference
In-Depth Information
public void setPrecipitation(String p, String pp, String pt) {
precipitation = p;
precipitationProb = pp;
precipitationType = pt;
}
public String getForecast() {
if (forecast != null) {
return forecast;
} else {
return "";
}
}
public void setForecast(String f) {
forecast = f;
}
public int getId() {
return recordid;
}
public void setId(int id) {
recordid = id;
}
public byte[] toBytes() {
byte[] b;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
// Record format is field-tag, then field for each
try {
dos.writeInt(FIELD_VERSION);
dos.writeInt(version);
if (city != null) {
dos.writeInt(FIELD_CITY);
dos.writeUTF(getCity());
}
if (state != null) {
dos.writeInt(FIELD_STATE);
dos.writeUTF(getState());
}
 
Search WWH ::




Custom Search