本文整理汇总了Java中org.opengts.db.dmtp.Property类的典型用法代码示例。如果您正苦于以下问题:Java Property类的具体用法?Java Property怎么用?Java Property使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Property类属于org.opengts.db.dmtp包,在下文中一共展示了Property类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBodyDataIterator
import org.opengts.db.dmtp.Property; //导入依赖的package包/类
/**
*** Creates and returns an iterator for the row data displayed in the body of this report.
*** @return The body row data iterator
**/
public DBDataIterator getBodyDataIterator()
{
/* init */
this.rowData = new Vector<FieldData>();
/* loop through properties */
String accountID = this.getAccountID();
String deviceID = this.getFirstDeviceID();
try {
Device device = this.getDevice(deviceID);
if (device != null) {
Property properties[] = Property.getProperties(accountID, deviceID);
if (properties != null) {
for (int i = 0; i < properties.length; i++) {
FieldData fd = new FieldData();
fd.setDevice(device);
fd.setString(FieldLayout.DATA_DEVICE_ID , deviceID);
fd.setLong( FieldLayout.DATA_TIMESTAMP , properties[i].getTimestamp());
fd.setLong( FieldLayout.DATA_PROPERTY_KEY , (long)properties[i].getPropKey());
fd.setString(FieldLayout.DATA_PROPERTY_DESC , properties[i].getDescription());
fd.setString(FieldLayout.DATA_PROPERTY_VALUE, properties[i].getValueAsString());
this.rowData.add(fd);
}
}
} else {
// should never occur
Print.logError("Returned DeviceList 'Device' is null: " + deviceID);
}
} catch (DBException dbe) {
Print.logError("Error retrieving Device: " + deviceID);
}
/* return data iterator */
return new ListDataIterator(this.rowData);
}