Package com.opengamma.engine.value

Examples of com.opengamma.engine.value.ValueProperties


      return null;
    }
    final String curveName = curveNames.iterator().next();
    final String curveCurrency = curveCurrencies.iterator().next();
    final String curveCalculationConfig = curveCalculationConfigs.iterator().next();
    final ValueProperties valueProperties = ValueProperties.builder()
        .withAny(ValuePropertyNames.CURRENCY)
        .with(ValuePropertyNames.CURVE, curveName)
        .with(ValuePropertyNames.CURVE_CURRENCY, curveCurrency)
        .with(ValuePropertyNames.CURVE_CALCULATION_CONFIG, curveCalculationConfig)
        .get();
View Full Code Here


    return requirements;
  }

  @Override
  public Set<ValueSpecification> getResults(final FunctionCompilationContext context, final ComputationTarget target) {
    final ValueProperties externalProperties = createCurrencyValueProperties(target)
                      .withAny(ValuePropertyNames.CURRENCY)
                      .withAny(ValuePropertyNames.CURVE)
                      .withAny(ValuePropertyNames.CURVE_CURRENCY)
                      .withAny(ValuePropertyNames.CURVE_CALCULATION_CONFIG).get();
    final Set<ValueSpecification> results = Collections.singleton(new ValueSpecification(PV01_REQUIREMENT, target.toSpecification(), externalProperties));
View Full Code Here

        curveCurrencyName = entry.getKey().getProperty(ValuePropertyNames.CURVE_CURRENCY);
        curveCalculationConfigName = entry.getKey().getProperty(ValuePropertyNames.CURVE_CALCULATION_CONFIG);
      }
    }
    assert curveName != null;
    final ValueProperties valueProperties = createCurrencyValueProperties(target).with(ValuePropertyNames.CURVE, curveName)
                                                                                 .with(ValuePropertyNames.CURVE_CURRENCY, curveCurrencyName)
                                                                                 .with(ValuePropertyNames.CURVE_CALCULATION_CONFIG, curveCalculationConfigName)
                                                                                 .get();
    final Set<ValueSpecification> results = Collections.singleton(new ValueSpecification(PV01_REQUIREMENT, targetSpec, valueProperties));
    return results;
View Full Code Here

    if (!(value instanceof LabelledMatrix1D)) {
      throw new OpenGammaRuntimeException("Yield Curve Node Sensitivities result was not of type LabelledMatrix1D");
    }
    final DoubleLabelledMatrix1D ycns = (DoubleLabelledMatrix1D) value;
    final double result = sum(ycns.getValues());
    final ValueProperties properties = createCurrencyValueProperties(target)
        .with(ValuePropertyNames.CURVE, curveName)
        .with(ValuePropertyNames.CURVE_CURRENCY, curveCurrency)
        .with(ValuePropertyNames.CURVE_CALCULATION_CONFIG, curveCalculationConfig)
        .get();
    final ComputedValue computedValue = new ComputedValue(new ValueSpecification(PV01_REQUIREMENT, specification, properties), result);
View Full Code Here

      JSONObject jsonObject = new JSONObject(_syntheticForm);
      if (jsonObject.has("infinity") && jsonObject.getBoolean("infinity")) {
        return ValueProperties.all();
      } else if (jsonObject.has("without")) {
        JSONArray withoutProperties = jsonObject.getJSONArray("without");
        ValueProperties requirement = ValueProperties.all();
        for (int i = 0; i < withoutProperties.length(); i++) {
          String without = (String) withoutProperties.get(i);
          requirement = requirement.withoutAny(without);
        }
        return requirement;
      } else if (jsonObject.has("properties") && jsonObject.getJSONArray("properties") != null) {
        JSONArray withProperties = jsonObject.getJSONArray("properties");
        final ValueProperties.Builder builder = ValueProperties.builder();
View Full Code Here

      final String valueRequirementsSyntheticForm = rs.getString("synthetic_form");
      final String targetTypeIdScheme = rs.getString("target_type_id_scheme");
      final String targetTypeIdValue = rs.getString("target_type_id_value");
      final String targetTypeIdVersion = rs.getString("target_type_id_version");
      final UniqueId targetId = UniqueId.of(targetTypeIdScheme, targetTypeIdValue, targetTypeIdVersion);
      final ValueProperties valueProperties = RiskValueProperties.parseJson(valueRequirementsSyntheticForm);
      final String configurationName = rs.getString("config_name");
      final ValueSpecification valueSpecification = ValueSpecification.of(valueName, computationTargetType, targetId, valueProperties);
      final ComputedValueResult computedValue = new ComputedValueResult(valueSpecification, value, AggregatedExecutionLog.EMPTY);
      final ViewResultEntry viewResultEntry = new ViewResultEntry(configurationName, computedValue);
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target, final Set<ValueRequirement> desiredValues) {
    final ComputedValue input = inputs.getAllValues().iterator().next();
    final ValueProperties constraints = desiredValues.iterator().next().getConstraints();
    final ValueProperties.Builder properties = createValueProperties();
    composeValueProperties(properties, input.getSpecification());
    final List<ComputedValue> values = sliceResults((List<ComputedValue>) input.getValue(), constraints, properties);
    return Collections.singleton(new ComputedValue(ValueSpecification.of(getValueName(), ComputationTargetType.PORTFOLIO_NODE, target.getUniqueId(), properties.get()), values));
  }
View Full Code Here

  }

  @Override
  public Set<ValueSpecification> getResults(final FunctionCompilationContext context, final ComputationTarget target) {
    final ComputationTargetSpecification targetSpec = target.toSpecification();
    final ValueProperties properties = createValueProperties().withAny(CURRENCY_MATRIX_NAME_PROPERTY).get();
    return ImmutableSet.of(createSpotRateResult(targetSpec, properties), createHistoricalTimeSeriesResult(targetSpec, properties), createTimeSeriesLatestResult(targetSpec, properties));
  }
View Full Code Here

  public Set<ValueSpecification> getResults(final FunctionCompilationContext context, final ComputationTarget target, final Map<ValueSpecification, ValueRequirement> inputs) {
    final Set<ValueSpecification> results = Sets.newHashSetWithExpectedSize(inputs.size());
    for (Map.Entry<ValueSpecification, ValueRequirement> inputEntry : inputs.entrySet()) {
      ValueProperties.Builder properties = createValueProperties();
      properties.with(CURRENCY_MATRIX_NAME_PROPERTY, inputEntry.getValue().getTargetReference().getRequirement().getIdentifiers().getValue(CurrencyMatrixResolver.IDENTIFIER_SCHEME));
      final ValueProperties inputProperties = inputEntry.getKey().getProperties();
      for (String propertyName : inputProperties.getProperties()) {
        if (!AbstractCurrencyMatrixSourcingFunction.SOURCE_CURRENCY_PROPERTY.equals(propertyName)
            && !AbstractCurrencyMatrixSourcingFunction.TARGET_CURRENCY_PROPERTY.equals(propertyName)
            && !ValuePropertyNames.FUNCTION.equals(propertyName)) {
          final Set<String> values = inputProperties.getValues(propertyName);
          if (values.isEmpty()) {
            properties.withAny(propertyName);
          } else {
            properties.with(propertyName, values);
          }
View Full Code Here

  @Test
  public void formatHistoryForValueNameWithUnknownType() {
    ResultsFormatter formatter = new ResultsFormatter();
    UniqueId uid = UniqueId.of("scheme", "value");
    ComputationTargetSpecification spec = new ComputationTargetSpecification(ComputationTargetType.POSITION, uid);
    ValueProperties props = ValueProperties.builder().with(ValuePropertyNames.FUNCTION, "fn").get();
    // if this works without an exception then the bug is fixed
    formatter.format(123d, new ValueSpecification("unknown value name", spec, props), TypeFormatter.Format.HISTORY, null);
  }
View Full Code Here

TOP

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

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.