Skip to content

Instantly share code, notes, and snippets.

@febintt
Created December 11, 2013 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save febintt/7909990 to your computer and use it in GitHub Desktop.
Save febintt/7909990 to your computer and use it in GitHub Desktop.
OG function definition save code.
/**
* 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;
/**
* 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(DoubleLastHistoricalValueFunction.class.getName()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment