Examples of CurrencyMatrixValue


Examples of com.opengamma.financial.currency.CurrencyMatrixValue

        final String targetISO = targetCurrency.getCode();
        final int cmp = sourceISO.compareTo(targetISO);
        if (cmp == 0) {
          continue;
        }
        final CurrencyMatrixValue value = object.getConversion(sourceCurrency, targetCurrency);
        if (value == null) {
          continue;
        }
        final boolean suppressInverse;
        if (targetCurrencies.contains(sourceCurrency) && sourceCurrencies.contains(targetCurrency)) {
          final CurrencyMatrixValue inverse = object.getConversion(targetCurrency, sourceCurrency);
          if (inverse == null) {
            suppressInverse = true;
          } else {
            if (cmp < 0) {
              suppressInverse = !value.getReciprocal().equals(inverse);
            } else {
              if (inverse.getReciprocal().equals(value)) {
                continue;
              }
              suppressInverse = true;
            }
          }
View Full Code Here

Examples of com.opengamma.financial.currency.CurrencyMatrixValue

        final Currency source = Currency.of(field.getName());
        final FudgeMsg message2 = message.getFieldValue(FudgeMsg.class, field);
        for (final FudgeField field2 : message2) {
          final Currency target = Currency.of(field2.getName());
          if (field2.getValue() instanceof Double) {
            final CurrencyMatrixValue value = CurrencyMatrixValue.of((Double) field2.getValue());
            values.put(Pair.of(source, target), value);
            values.put(Pair.of(target, source), value.getReciprocal());
          } else {
            values.remove(Pair.of(target, source));
          }
        }
        for (final Map.Entry<Pair<Currency, Currency>, CurrencyMatrixValue> valueEntry : values.entrySet()) {
View Full Code Here

Examples of com.opengamma.financial.currency.CurrencyMatrixValue

      for (final FudgeField field : message) {
        final Currency source = Currency.of(field.getName());
        for (final FudgeField field2 : message.getFieldValue(FudgeMsg.class, field)) {
          final Currency target = Currency.of(field2.getName());
          if (field2.getValue() instanceof FudgeMsg) {
            final CurrencyMatrixValue value = deserializer.fieldValueToObject(CurrencyMatrixValueRequirement.class, field2);
            values.put(Pair.of(source, target), value);
            values.put(Pair.of(target, source), value.getReciprocal());
          } else {
            values.remove(Pair.of(target, source));
          }
        }
        for (final Map.Entry<Pair<Currency, Currency>, CurrencyMatrixValue> valueEntry : values.entrySet()) {
View Full Code Here

Examples of com.opengamma.financial.currency.CurrencyMatrixValue

    }

    private void loadCross(final FudgeMsg message) {
      final Map<Pair<Currency, Currency>, CurrencyMatrixValue> values = new HashMap<Pair<Currency, Currency>, CurrencyMatrixValue>();
      for (final FudgeField field : message) {
        final CurrencyMatrixValue cross = CurrencyMatrixValue.of(Currency.of(field.getName()));
        for (final FudgeField field2 : (FudgeMsg) field.getValue()) {
          final Currency source = Currency.of(field2.getName());
          if (field2.getValue() instanceof FudgeMsg) {
            final Currency target = Currency.of(((FudgeMsg) field2.getValue()).iterator().next().getName());
            values.put(Pair.of(source, target), cross);
View Full Code Here

Examples of com.opengamma.financial.currency.CurrencyMatrixValue

      final Random r = new Random();
      for (char source = 'A'; source < 'Z'; source++) {
        final Currency sourceCurrency = Currency.of("AA" + source);
        for (char target = (char) (source + 1); target <= 'Z'; target++) {
          final Currency targetCurrency = Currency.of("AA" + target);
          CurrencyMatrixValue value = randomValue(r);
          if (value != null) {
            addConversion(sourceCurrency, targetCurrency, value);
            if (r.nextBoolean()) {
              addConversion(targetCurrency, sourceCurrency, value.getReciprocal());
            } else {
              value = randomValue(r);
              if (value != null) {
                addConversion(targetCurrency, sourceCurrency, value);
              }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.