Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4772/src/net/sourceforge/bprocessor/model/sense
Modified Files:
SensorItem.java
Added Files:
SensorStorage.java
Log Message:
Index: SensorItem.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/sense/SensorItem.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SensorItem.java 12 Feb 2010 11:44:28 -0000 1.2
--- SensorItem.java 7 May 2010 13:35:58 -0000 1.3
***************
*** 11,19 ****
import java.text.DecimalFormat;
import java.util.Date;
/**
*
*/
! public class SensorItem {
private String id;
private long time;
--- 11,24 ----
import java.text.DecimalFormat;
import java.util.Date;
+ import java.util.List;
+
+ import net.sourceforge.bprocessor.model.Attribute;
+ import net.sourceforge.bprocessor.model.Entity;
+ import net.sourceforge.bprocessor.model.Parametric;
/**
*
*/
! public class SensorItem extends Entity implements Parametric {
private String id;
private long time;
***************
*** 59,62 ****
--- 64,75 ----
/**
*
+ * @return time
+ */
+ public long getTime() {
+ return time;
+ }
+
+ /**
+ *
* @return id
*/
***************
*** 116,118 ****
--- 129,170 ----
+ format.format(humidity) + "%" + "}";
}
+
+ /**
+ * {@inheritDoc}
+ */
+ public void delete() {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<Attribute> getAttributes() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAttributes(List<Attribute> attributes) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String title() {
+ // TODO Auto-generated method stub
+ return toString();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getName() {
+ return title();
+ }
}
--- NEW FILE: SensorStorage.java ---
//---------------------------------------------------------------------------------
// $Id: SensorStorage.java,v 1.1 2010/05/07 13:35:58 henryml Exp $
//
// Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net)
// Released under the Lesser GNU Public License v2.1
//---------------------------------------------------------------------------------
package net.sourceforge.bprocessor.model.sense;
import java.util.LinkedList;
import java.util.List;
import net.sourceforge.bprocessor.model.Attribute;
import net.sourceforge.bprocessor.model.Entity;
import net.sourceforge.bprocessor.model.Parametric;
/**
*
*/
public class SensorStorage extends Entity implements Parametric {
private List<SensorItem> items;
private long time;
private long id;
/**
* @param id id
*/
public SensorStorage(long id) {
this.id = id;
items = new LinkedList();
time = 0;
}
/**
*
* @param delta delta
*/
public void update(List<SensorItem> delta) {
for (SensorItem current : delta) {
if (current.getTime() > time) {
items.add(current);
time = current.getTime();
}
}
}
/**
* {@inheritDoc}
*/
public void delete() {
}
/**
* {@inheritDoc}
*/
public List<Attribute> getAttributes() {
// TODO Auto-generated method stub
return null;
}
/**
* {@inheritDoc}
*/
public void setAttributes(List<Attribute> attributes) {
// TODO Auto-generated method stub
}
/**
* {@inheritDoc}
*/
public List<SensorItem> getItems() {
return items;
}
/**
* {@inheritDoc}
*/
public String title() {
return "Sensor Data";
}
/**
*
* @return id
*/
public long getid() {
return id;
}
}
|