/v3.2/nimbits-model/src/com/nimbits/client/model/value/ValueModel.java
http://nimbits-server.googlecode.com/ · Java · 134 lines · 82 code · 35 blank · 17 comment · 1 complexity · dee79e5deea4a6fa2f3ae878f3a8b2a5 MD5 · raw file
- /*
- * Copyright (c) 2010 Tonic Solutions LLC.
- *
- * http://www.nimbits.com
- *
- *
- * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/gpl.html
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- */
-
- package com.nimbits.client.model.value;
-
-
- import java.util.Date;
-
-
- public class ValueModel implements Value {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private long id;
- private double lat;
- private double lng;
- private double d;
- private Date timestamp;
- private long pointFK;
- private String note;
- private String data;
-
-
- public ValueModel() {
- }
-
- @Override
- public void setAlertState(final AlertType alertState) {
- this.alertState = alertState;
- }
-
- @Override
- public String getData() {
- return this.data;
- }
-
-
- private AlertType alertState;
-
- public ValueModel(final Value v) {
- this.id = v.getId();
- this.lat = v.getLatitude();
- this.lng = v.getLongitude();
- this.d = v.getValue();
- this.timestamp = v.getTimestamp();
- this.pointFK = v.getPoint();
- this.note = v.getNote();
- this.data = v.getData();
- // this.tag = v.getTag();
- }
-
- public ValueModel(final double lat,
- final double lng,
- final double d,
- final Date timestamp,
- final long pointFK,
- final String note,
- final String data) {
- this.id = 0;
- this.lat = lat;
- this.lng = lng;
- this.d = d;
- this.timestamp = new Date(timestamp.getTime());
- this.pointFK = pointFK;
- this.note = note;
- this.data = data;
-
- }
-
-
- //
- @Override
- public long getId() {
- return id;
- }
-
-
- @Override
- public String getNote() {
- return note == null ? "" : note;
-
- }
-
-
- @Override
- public double getLatitude() {
- return lat;
- }
-
-
- @Override
- public double getLongitude() {
-
- return lng;
- }
-
-
- @Override
- public long getPoint() {
- return pointFK;
- }
-
-
- @Override
- public double getValue() {
- return this.d;
-
- }
-
-
- @Override
- public Date getTimestamp() {
- return new Date(this.timestamp.getTime());
- }
-
- @Override
- public AlertType getAlertState() {
- return this.alertState;
- }
-
-
- }