001 package org.hackystat.telemetry.analyzer.reducer; 002 003 import org.hackystat.telemetry.analyzer.reducer.jaxb.Parameters; 004 import org.hackystat.telemetry.analyzer.reducer.jaxb.ReducerDefinition; 005 006 /** 007 * Provides information about a single Telemetry Reduction Function. 008 * 009 * @author (Cedric) Qin Zhang, Philip Johnson 010 */ 011 public class TelemetryReducerInfo { 012 013 /** The instance. */ 014 private TelemetryReducer reducer; 015 /** The ReducerDefinition instance obtained from the XML. */ 016 private ReducerDefinition definition; 017 018 /** 019 * Constructs this instance. 020 * 021 * @param reducer The concrete instance of telemetry reducer. 022 * @param definition The ReducerDefinition. 023 */ 024 TelemetryReducerInfo(TelemetryReducer reducer, ReducerDefinition definition) { 025 this.reducer = reducer; 026 this.definition = definition; 027 } 028 029 /** 030 * Gets the name of the telemetry reducer. 031 * 032 * @return The name. 033 */ 034 public String getName() { 035 return this.definition.getName(); 036 } 037 038 /** 039 * Gets the instance of the telemetry reducer. 040 * 041 * @return The instance. 042 */ 043 public TelemetryReducer getReducer() { 044 return this.reducer; 045 } 046 047 /** 048 * Gets the description of this reducer. 049 * 050 * @return The description of the reducer. 051 */ 052 public String getReducerDescription() { 053 return this.definition.getDescription(); 054 } 055 056 /** 057 * Gets the description of the parameters this reducer takes. 058 * 059 * @return The description of the options. 060 */ 061 public Parameters getParameterDescription() { 062 //Should return the Parameters object. 063 return definition.getParameters(); 064 } 065 }