Created
December 13, 2013 13:36
-
-
Save febintt/7944299 to your computer and use it in GitHub Desktop.
Adding the function to the function repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies | |
* | |
* Please see distribution for license. | |
*/ | |
package com.opengamma.algotree.function; | |
import java.util.List; | |
import com.opengamma.engine.function.config.AbstractFunctionConfigurationBean; | |
import com.opengamma.engine.function.config.FunctionConfiguration; | |
import com.opengamma.engine.function.config.FunctionConfigurationSource; | |
import com.opengamma.engine.function.config.StaticFunctionConfiguration; | |
import com.opengamma.financial.analytics.AnalyticsFunctions; | |
/** | |
* Function repository configuration source for the functions contained in this package. | |
*/ | |
public class MyFunctions extends AbstractFunctionConfigurationBean { | |
/** | |
* Default instance of a repository configuration source exposing the functions from this package. | |
* | |
* @return the configuration source exposing functions from this package | |
*/ | |
public static FunctionConfigurationSource instance() { | |
return new MyFunctions().getObjectCreating(); | |
} | |
@Override | |
protected void addAllConfigurations(final List<FunctionConfiguration> functions) { | |
System.out.println("Adding new MY FUNCTION"); | |
functions.add(new StaticFunctionConfiguration(MyFunction.class.getName())); | |
System.out.println("Adding new DOUBLE_CLOSE FUNCTION"); | |
functions.add(new StaticFunctionConfiguration(MarketValueFromLastHistoricalValueFunction.class.getName())); | |
AnalyticsFunctions.addScalingAndSummingFunction(functions, MarketValueFromLastHistoricalValueFunction.MARKET_VALUE_NAME); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment