public static AbsoluteSchedule getHistoricalDataSchedule(SingleValueResource resource) throws IllegalArgumentException { AbsoluteSchedule schedule = null; if (resource instanceof FloatResource) schedule = ((FloatResource) resource).historicalData(); else if (resource instanceof IntegerResource) schedule = ((IntegerResource) resource).historicalData(); else if (resource instanceof TimeResource) schedule = ((TimeResource) resource).historicalData(); else if (resource instanceof BooleanResource) schedule = ((BooleanResource) resource).historicalData(); else if (resource instanceof StringResource) throw new IllegalArgumentException("Logging for StringResources not possible"); return schedule; }
/** * Returns the <code>historicalData</code> subresource of a {@link FloatResource}, {@link IntegerResource}, * {@link FloatResource}, {@link BooleanResource}, or {@link TimeResource}. * @param resource * @return * @throws IllegalArgumentException * if <code>resource</code> is a {@link StringResource}. Logging StringResources is not possible. */ public static AbsoluteSchedule getHistoricalDataSchedule(SingleValueResource resource) throws IllegalArgumentException { AbsoluteSchedule schedule = null; if (resource instanceof FloatResource) schedule = ((FloatResource) resource).historicalData(); else if (resource instanceof IntegerResource) schedule = ((IntegerResource) resource).historicalData(); else if (resource instanceof TimeResource) schedule = ((TimeResource) resource).historicalData(); else if (resource instanceof BooleanResource) schedule = ((BooleanResource) resource).historicalData(); else if (resource instanceof StringResource) throw new IllegalArgumentException("Logging for StringResources not possible"); return schedule; }