private static RecordedData getHistoricalData(SingleValueResource resource) { RecordedData rd = null; if (resource instanceof FloatResource) rd = ((FloatResource) resource).getHistoricalData(); else if (resource instanceof IntegerResource) rd = ((IntegerResource) resource).getHistoricalData(); else if (resource instanceof TimeResource) rd = ((TimeResource) resource).getHistoricalData(); else if (resource instanceof BooleanResource) rd = ((BooleanResource) resource).getHistoricalData(); else throw new IllegalArgumentException("Logging not possible for resource of type " + resource.getResourceType().getName()); return rd; }
/** * See also {@link #getHistoricalDataSchedule(SingleValueResource)}, which provides an alternative * access to log data, via a {@link Schedule}. * @param resource * @return * @throws IllegalArgumentException * if <code>resource</code> is a {@link StringResource}. Logging StringResources is not possible. */ public static RecordedData getHistoricalData(SingleValueResource resource) throws IllegalArgumentException { RecordedData rd = null; if (resource instanceof FloatResource) rd = ((FloatResource) resource).getHistoricalData(); else if (resource instanceof IntegerResource) rd = ((IntegerResource) resource).getHistoricalData(); else if (resource instanceof TimeResource) rd = ((TimeResource) resource).getHistoricalData(); else if (resource instanceof BooleanResource) rd = ((BooleanResource) resource).getHistoricalData(); else if (resource instanceof StringResource) throw new IllegalArgumentException("Logging for StringResources not possible"); return rd; }
/** Get Recorded data from SingleValueResource * * @param valueResource * @return null if type of resource does not support getHistoricalData */ public static RecordedData getRecordedData(SingleValueResource valueResource) { if(valueResource instanceof FloatResource) return ((FloatResource)valueResource).getHistoricalData(); if(valueResource instanceof IntegerResource) return ((IntegerResource)valueResource).getHistoricalData(); if(valueResource instanceof TimeResource) return ((TimeResource)valueResource).getHistoricalData(); if(valueResource instanceof BooleanResource) return ((BooleanResource)valueResource).getHistoricalData(); return null; } }
private RecordedData getHistoricalData() { if (parentResource instanceof FloatResource) { return ((FloatResource) parentResource).getHistoricalData(); } else if (parentResource instanceof BooleanResource) { return ((BooleanResource) parentResource).getHistoricalData(); } else if (parentResource instanceof IntegerResource) { return ((IntegerResource) parentResource).getHistoricalData(); } else if (parentResource instanceof TimeResource) { return ((TimeResource) parentResource).getHistoricalData(); } else return null; }
switch (dataType.getDataType()) { case 0: ts = tr.getHistoricalData(); break; case 1: