Package com.opengamma.analytics.util.serialization

Examples of com.opengamma.analytics.util.serialization.InvokedSerializedForm


    assertEquals(obj.toString(), "InvokedSerializedForm[Test, DynamicExamplePrimitive, 42.0]");
    assertEquals(obj.readReplace(), "dynamic-prefixed-primitive-arg-42.0");
  }

  public void testObjectArgStaticMethod() {
    InvokedSerializedForm obj = new InvokedSerializedForm(InvokedSerializedFormTest.class, "staticExample", 42d);
    assertEquals(obj.toString(), "InvokedSerializedForm[com.opengamma.analytics.util.InvokedSerializedFormTest, staticExample, 42.0]");
    assertEquals(obj.readReplace(), "static-object-arg-42.0");
    obj = new InvokedSerializedForm(InvokedSerializedFormTest.class, "getStaticExample", 42d);
    assertEquals(obj.toString(), "InvokedSerializedForm[com.opengamma.analytics.util.InvokedSerializedFormTest, StaticExample, 42.0]");
    assertEquals(obj.readReplace(), "static-prefixed-object-arg-42.0");
  }
View Full Code Here


    assertEquals(obj.toString(), "InvokedSerializedForm[com.opengamma.analytics.util.InvokedSerializedFormTest, StaticExample, 42.0]");
    assertEquals(obj.readReplace(), "static-prefixed-object-arg-42.0");
  }

  public void testObjectArgDynamicMethod() {
    InvokedSerializedForm obj = new InvokedSerializedForm(this, "dynamicExample", 42d);
    assertEquals(obj.toString(), "InvokedSerializedForm[Test, dynamicExample, 42.0]");
    assertEquals(obj.readReplace(), "dynamic-object-arg-42.0");
    obj = new InvokedSerializedForm(this, "getDynamicExample", 42d);
    assertEquals(obj.toString(), "InvokedSerializedForm[Test, DynamicExample, 42.0]");
    assertEquals(obj.readReplace(), "dynamic-prefixed-object-arg-42.0");
  }
View Full Code Here

        throw new IllegalArgumentException("Message did not contain an outer object");
      }
      if (method == null) {
        throw new IllegalArgumentException("Message did not contain an invocation reference");
      }
      final InvokedSerializedForm isr;
      if (parameters != null) {
        isr = new InvokedSerializedForm(outer, method, parameters);
      } else {
        isr = new InvokedSerializedForm(outer, method);
      }
      return isr.readReplace();
    }
View Full Code Here

      public Double evaluate(final Double... x) {
        return _boolean ? _int * a * x[0] : a * x[0] + b * x[1] * x[1];
      }

      public Object writeReplace() {
        return new InvokedSerializedForm(TestStatefulFunction.this, "getSurface", a, b);
      }
    };
  }
View Full Code Here

        return x * x;
      }
    };
    return new FunctionalDoublesCurve(f) {
      public Object writeReplace() {
        return new InvokedSerializedForm(ModelForwardCurveTest.class, "getForwardCurve");
      }
    };
  }
View Full Code Here

      public Double evaluate(final Double... x) {
        return a * x[0] + b * x[1] * x[1];
      }

      public Object writeReplace() {
        return new InvokedSerializedForm(TestStatelessFunction.class, "getSurface", a, b);
      }
    };
    return f;
  }
View Full Code Here

      public boolean equals(final Object o) {
        return true;
      }

      public Object writeReplace() {
        return new InvokedSerializedForm(FunctionalDoublesSurface.class, "getParameterizedFunction");
      }

    }, "NAME2");
    final VolatilitySurface otherVol = new VolatilitySurface(otherF);
    other = new FunctionalVolatilitySurfaceData(otherVol, X_LABEL, X_MIN, X_MAX, NX, Y_LABEL, Y_MIN, Y_MAX, NY, Z_MIN, Z_MAX);
View Full Code Here

      public final U evaluate(final T params) {
        return ParameterizedFunction.this.evaluate(x, params);
      }

      public Object writeReplace() {
        return new InvokedSerializedForm(ParameterizedFunction.this, "asFunctionOfParameters", x);
      }

    };
  }
View Full Code Here

      public U evaluate(final S x) {
        return ParameterizedFunction.this.evaluate(x, params);
      }

      public Object writeReplace() {
        return new InvokedSerializedForm(ParameterizedFunction.this, "asFunctionOfArguments", params);
      }

    };
  }
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.util.serialization.InvokedSerializedForm

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.