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