Package com.opengamma.engine.target

Examples of com.opengamma.engine.target.ComputationTargetType$Parser


    // ComputationTargetReferenceVisitor

    @Override
    public ComputationTargetReference visitComputationTargetRequirement(final ComputationTargetRequirement requirement) {
      final ComputationTargetType leafType = getLeafType(requirement.getType());
      if (leafType != null) {
        return MemoryUtils.instance(new ComputationTargetRequirement(leafType, requirement.getIdentifiers()));
      } else {
        return requirement;
      }
View Full Code Here


    }

    @Override
    public ComputationTargetReference visitComputationTargetSpecification(final ComputationTargetSpecification specification) {
      if ((specification.getUniqueId() != null) && specification.getUniqueId().isLatest()) {
        final ComputationTargetType leafType = getLeafType(specification.getType());
        if (leafType != null) {
          return MemoryUtils.instance(new ComputationTargetSpecification(leafType, specification.getUniqueId()));
        } else {
          return specification;
        }
View Full Code Here

  // DependencyNodeFilter

  @Override
  public boolean accept(final DependencyNode node) {
    final ComputationTargetType nodeType = node.getComputationTarget().getType();
    if (nodeType.isTargetType(ComputationTargetType.PORTFOLIO_NODE)) {
      return !_badNodes.contains(node.getComputationTarget().getUniqueId());
    }
    return !nodeType.isTargetType(ComputationTargetType.PORTFOLIO);
  }
View Full Code Here

   */
  @Deprecated
  private ValueRequirement plat2286Translate(final ValueRequirement valueRequirement) {
    if (valueRequirement.getTargetReference() instanceof ComputationTargetSpecification) {
      final ComputationTargetSpecification targetSpec = valueRequirement.getTargetReference().getSpecification();
      final ComputationTargetType type;
      if (targetSpec.getUniqueId() == null) {
        return valueRequirement;
      }
      if (Currency.OBJECT_SCHEME.equals(targetSpec.getUniqueId().getScheme())) {
        type = ComputationTargetType.CURRENCY;
View Full Code Here

   * @return true if the output value should be included in the results
   */
  public boolean shouldOutputResult(ValueSpecification outputSpecification, DependencyGraph dependencyGraph) {
    ArgumentChecker.notNull(outputSpecification, "outputSpecification");
    ArgumentChecker.notNull(dependencyGraph, "dependencyGraph");
    ComputationTargetType targetType = outputSpecification.getTargetSpecification().getType();
    return getOutputMode(targetType).shouldOutputResult(outputSpecification, dependencyGraph);
  }
View Full Code Here

   *
   * @param dependencyNode  the dependency node, not null
   * @return true if any outputs are produces that should be included in the results
   */
  public boolean shouldOutputFromNode(DependencyNode dependencyNode) {
    ComputationTargetType targetType = dependencyNode.getComputationTarget().getType();
    return getOutputMode(targetType).shouldOutputFromNode(dependencyNode);
  }
View Full Code Here

    }

  };

  public static ComputationTargetReference buildObjectImpl(final FudgeDeserializer deserializer, final FudgeMsg message) {
    ComputationTargetType type = ComputationTargetTypeFudgeBuilder.buildObjectImpl(message);
    final List<ComputationTargetType> types = type.accept(s_getNestedType, null);
    if (types == null) {
      if (message.getByName(IDENTIFIER_FIELD_NAME) == null) {
        return ComputationTargetSpecification.NULL;
      } else {
        return new ComputationTargetRequirement(type, ExternalIdBundle.EMPTY);
View Full Code Here

  }

  @Override
  public boolean canApplyTo(FunctionCompilationContext context, ComputationTarget target) {
    FunctionSignature signature = getFunctionSignature();
    ComputationTargetType ctt = signature.getComputationTargetType();
    Class ctc = signature.getComputationTargetClass();
    if (ctt != null && !target.getType().equals(ctt)) {
      return false;
    }
    if (ctc != null && !ctc.isAssignableFrom(target.getValue().getClass())) {
View Full Code Here

   * Adds a single rule to the resolver. Rules must be added before calling {@link #compileRules} to pre-process them into the data structures used for resolution.
   *
   * @param resolutionRule the rule to add, not null
   */
  public void addRule(ResolutionRule resolutionRule) {
    final ComputationTargetType type = resolutionRule.getParameterizedFunction().getFunction().getTargetType();
    type.accept(s_createChainedRuleBundle, this);
    final Iterable<Collection<ResolutionRule>> rules = _type2Rules.getDirect(type);
    assert rules != null; // s_createChainedRuleBundle should have done this
    final ChainedRuleBundle bundle;
    if (rules instanceof ChainedRuleBundle) {
      bundle = (ChainedRuleBundle) rules;
View Full Code Here

   * @param type the declared type to reduce the target to, not null
   * @param target the target to reduce, not null
   * @return the reduced target, or null if the reduction is not possible
   */
  public static ComputationTarget adjustTarget(final ComputationTargetType type, final ComputationTarget target) {
    final ComputationTargetType adjusted = type.accept(s_getAdjustedTargetType, target);
    if (adjusted == null) {
      // Not compatible
      return null;
    } else if (adjusted == ComputationTargetType.NULL) {
      // Exact match
View Full Code Here

TOP

Related Classes of com.opengamma.engine.target.ComputationTargetType$Parser

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.