Package com.opengamma.engine.value

Examples of com.opengamma.engine.value.ComputedValue


  private ComputedValue createComputedValue(Object value) {
    return createComputedValue("test", value);
  }
 
  private ComputedValue createComputedValue(String valueName, Object value) {
    return new ComputedValue(createValueSpecification(valueName), value);
  }
View Full Code Here


      node.setFunction(new ParameterizedFunction(msdf, msdf.getDefaultParameters()));
    } else {
      final MockFunction mock = new MockFunction(target);
      output = new ValueSpecification(name, target.toSpecification(), ValueProperties.with(ValuePropertyNames.FUNCTION, mock.getUniqueId()).get());
      node.setFunction(mock);
      mock.addResult(new ComputedValue(output, null));
    }
    node.addOutputValue(output);
    node.addInputNodes(inputNodes);
    return node;
  }
View Full Code Here

    return node;
  }

  private void put(final ViewComputationCache cache, final DependencyNode node, final Object value) {
    final ValueSpecification spec = node.getOutputValues().iterator().next();
    cache.putSharedValue(new ComputedValue(spec, value));
  }
View Full Code Here

    new FunctionInputsImpl(s_resolver.atVersionCorrection(VersionCorrection.LATEST), (ComputedValue) null);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void cyclicalValue() {
    new FunctionInputsImpl(s_resolver.atVersionCorrection(VersionCorrection.LATEST), new ComputedValue(SPEC1, new ComputedValue(SPEC1, "")));
  }
View Full Code Here

          createValueProperties()
          .with(ValuePropertyNames.SURFACE, surfaceName)
          .with(InstrumentTypeProperties.PROPERTY_SURFACE_INSTRUMENT_TYPE, instrumentType)
          .with(SurfaceAndCubePropertyNames.PROPERTY_SURFACE_QUOTE_TYPE, specification.getSurfaceQuoteType())
          .with(SurfaceAndCubePropertyNames.PROPERTY_SURFACE_UNITS, specification.getQuoteUnits()).get());
      return Collections.singleton(new ComputedValue(result, volSurfaceData));
    }
View Full Code Here

public class HistoricalTimeSeriesLatestSecurityValueFunction extends AbstractFunction.NonCompiledInvoker {

  @Override
  public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs,
      final ComputationTarget target, final Set<ValueRequirement> desiredValues) {
    final ComputedValue latestHtsValue = inputs.getComputedValue(ValueRequirementNames.HISTORICAL_TIME_SERIES_LATEST);
    final ValueRequirement desiredValue = desiredValues.iterator().next();
    return Collections.singleton(new ComputedValue(new ValueSpecification(desiredValue.getValueName(), target.toSpecification(), desiredValue.getConstraints()), latestHtsValue.getValue()));
  }
View Full Code Here

      if (hts == null) {
        throw new OpenGammaRuntimeException("Can't get time series for " + timeSeriesRequirement);
      }
      timeSeries.add(timeSeriesRequirement.getConstraint(HistoricalTimeSeriesFunctionUtils.DATA_FIELD_PROPERTY), timeSeriesSource.getExternalIdBundle(hts.getUniqueId()), hts);
    }
    return Collections.singleton(new ComputedValue(new ValueSpecification(ValueRequirementNames.YIELD_CURVE_INSTRUMENT_CONVERSION_HISTORICAL_TIME_SERIES, target.toSpecification(), desiredValue
        .getConstraints()), timeSeries));
  }
View Full Code Here

            createValueProperties()
            .with(ValuePropertyNames.SURFACE, surfaceName)
            .with(InstrumentTypeProperties.PROPERTY_SURFACE_INSTRUMENT_TYPE, instrumentType)
            .with(SurfaceAndCubePropertyNames.PROPERTY_SURFACE_QUOTE_TYPE, specification.getSurfaceQuoteType())
            .with(SurfaceAndCubePropertyNames.PROPERTY_SURFACE_UNITS, specification.getQuoteUnits()).get());
        return Collections.singleton(new ComputedValue(spec, specification));
      }

      @Override
      public ComputationTargetType getTargetType() {
        return ComputationTargetType.ANYTHING;
View Full Code Here

        }
      }
    }
    final ValueSpecification spec = new ValueSpecification(ValueRequirementNames.CURVE_INSTRUMENT_CONVERSION_HISTORICAL_TIME_SERIES, targetSpec,
        desiredValue.getConstraints().copy().get());
    return Collections.singleton(new ComputedValue(spec, bundle));
  }
View Full Code Here

        @SuppressWarnings("synthetic-access")
        final ValueSpecification spec = new ValueSpecification(ValueRequirementNames.VOLATILITY_SURFACE_DEFINITION, target.toSpecification(),
            createValueProperties()
            .with(ValuePropertyNames.SURFACE, surfaceName)
            .with(InstrumentTypeProperties.PROPERTY_SURFACE_INSTRUMENT_TYPE, instrumentType).get());
        return Collections.singleton(new ComputedValue(spec, definition));
      }

      @Override
      public ComputationTargetType getTargetType() {
        return ComputationTargetType.ANYTHING;
View Full Code Here

TOP

Related Classes of com.opengamma.engine.value.ComputedValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.