Package com.opengamma.engine.value

Examples of com.opengamma.engine.value.ValueSpecification


    final int row = cell.getRow();
    final int col = cell.getColumn();
    final ComputationTargetSpecification target = new ComputationTargetSpecification(ComputationTargetType.POSITION,
                                                                               UniqueId.of("Cell", row + "," + col));
    final ValueProperties properties = ValueProperties.with(ValuePropertyNames.FUNCTION, "fnName").get();
    return Pair.of("Default", new ValueSpecification("valueName(" + row + "," + col + ")", target, properties));
  }
View Full Code Here


        converted = convertValue(inputValue, desiredValue, exchangeRate);
      } else {
        return null;
      }
      if (converted != null) {
        return Collections.singleton(new ComputedValue(new ValueSpecification(desiredValue.getValueName(), target.toSpecification(), desiredValue.getConstraints()), converted));
      } else {
        return null;
      }
    }
  }
View Full Code Here

  @Override
  public Set<ValueSpecification> getResults(final FunctionCompilationContext context, final ComputationTarget target) {
    // Maximal set of outputs is the valueNames with the infinite property set
    final ComputationTargetSpecification targetSpec = target.toSpecification();
    if (getValueNames().size() == 1) {
      return Collections.singleton(new ValueSpecification(getValueNames().iterator().next(), targetSpec, ValueProperties.all()));
    }
    final Set<ValueSpecification> result = new HashSet<ValueSpecification>();
    for (final String valueName : getValueNames()) {
      result.add(new ValueSpecification(valueName, targetSpec, ValueProperties.all()));
    }
    return result;
  }
View Full Code Here

  public Set<ValueSpecification> getResults(final FunctionCompilationContext context, final ComputationTarget target, final Map<ValueSpecification, ValueRequirement> inputs) {
    final Map.Entry<ValueSpecification, ValueRequirement> input = inputs.entrySet().iterator().next();
    if (input.getValue().getConstraints().getValues(CURRENCY_INJECTION_PROPERTY) == null) {
      // Resolved output is the input with the currency wild-carded, and the function ID the same (this is so that after composition the node might
      // be removed from the graph)
      final ValueSpecification value = input.getKey();
      return Collections.singleton(new ValueSpecification(value.getValueName(), value.getTargetSpecification(), value.getProperties().copy().withAny(ValuePropertyNames.CURRENCY).get()));
    }
    // The input was requested with the converted currency, so return the same specification to remove this node from the graph
    return Collections.singleton(input.getKey());
  }
View Full Code Here

    // The input was requested with the converted currency, so return the same specification to remove this node from the graph
    return Collections.singleton(input.getKey());
  }

  private String getCurrency(final Collection<ValueSpecification> specifications) {
    final ValueSpecification specification = specifications.iterator().next();
    final Set<String> currencies = specification.getProperties().getValues(ValuePropertyNames.CURRENCY);
    if ((currencies == null) || (currencies.size() != 1)) {
      return null;
    }
    return currencies.iterator().next();
  }
View Full Code Here

    final String calculationConfigName = "config_1";

    _compTargetSpec = new ComputationTargetSpecification(ComputationTargetType.SECURITY, UniqueId.of("Sec", "APPL"));

    _requirement = new ValueRequirement("FAIR_VALUE", _compTargetSpec);
    _specification = new ValueSpecification("FAIR_VALUE", _compTargetSpec, ValueProperties.with(ValuePropertyNames.FUNCTION, "IDENTITY_FUNCTION").get());

    _cycleMetadataStub = new ViewCycleMetadata() {

      @Override
      public UniqueId getViewCycleId() {
View Full Code Here

  @Override
  public Set<ComputedValue> execute(FunctionExecutionContext executionContext, FunctionInputs inputs, ComputationTarget target, Set<ValueRequirement> desiredValues) {
    //final ValueSpecification spec = new ValueSpecification(ValueRequirementNames.YIELD_CURVE, target.toSpecification(), properties);
    ValueProperties outputProperties = createValueProperties().get();
    ValueSpecification spec = new ValueSpecification(ValueRequirementNames.TARGET, target.toSpecification(), outputProperties);
    //return new ValueSpecification(_newValueName, inputSpec.getTargetSpecification(), outputProperties);
    return ImmutableSet.of(new ComputedValue(spec, target.getValue()));
  }
View Full Code Here

    return true;
  }

  @Override
  public Set<ValueSpecification> getResults(FunctionCompilationContext context, ComputationTarget target) {
    return ImmutableSet.of(new ValueSpecification(ValueRequirementNames.TARGET, target.toSpecification(), ValueProperties.all()));
  }
View Full Code Here

  public Set<ValueSpecification> getResults(FunctionCompilationContext context, ComputationTarget target, Map<ValueSpecification, ValueRequirement> inputs) {
    if (!inputs.isEmpty()) { // doesn't take any inputs
      return null;
    }
    ValueProperties outputProperties = createValueProperties().get();
    ValueSpecification spec = new ValueSpecification(ValueRequirementNames.TARGET, target.toSpecification(), outputProperties);
    return ImmutableSet.of(spec);
    //ValueSpecification inputSpec = Iterables.getOnlyElement(inputs.keySet());
    //return ImmutableSet.of(getOutputSpec(inputSpec));
  }
View Full Code Here

  protected ValueSpecification getOutputSpec(ValueSpecification inputSpec) {
    ValueProperties outputProperties = inputSpec.getProperties().copy()
        .withoutAny(ValuePropertyNames.FUNCTION)
        .with(ValuePropertyNames.FUNCTION, getUniqueId()).get();
    return new ValueSpecification(ValueRequirementNames.TARGET, inputSpec.getTargetSpecification(), outputProperties);
  }
View Full Code Here

TOP

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

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.