本文整理匯總了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);
}