Java 类org.omg.CORBA.DoubleHolder 实例源码

项目:javify    文件:DemoServant.java   
/**
 * Accept and return parameters, having various types.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  System.out.println("SERVER: ***** Test passing multiple parameters");
  System.out.println("SERVER:   Received:");
  System.out.println("SERVER:   octet " + an_octet.value);
  System.out.println("SERVER:   short " + a_short.value);
  System.out.println("SERVER:   string " + a_string.value);

  // Returning incremented values.
  an_octet.value++;
  a_short.value++;

  // OUT parameter, return only.
  a_double.value = 1;
  a_string.value += " [return]";
  return 452572;
}
项目:javify    文件:DirectTest.java   
/**
 * Test passing multiple parameters in both directions.
 */
public void testParameters()
{
  System.out.println("***** Pass multiple parameters.");

  // Holder classes are required to simulate passing
  // "by reference" (modification is returned back to the server).
  ByteHolder a_byte = new ByteHolder((byte) 0);
  ShortHolder a_short = new ShortHolder((short) 3);
  StringHolder a_string = new StringHolder("[string 4]");

  // This is an 'out' parameter; the value must not be passed to servant.
  DoubleHolder a_double = new DoubleHolder(56.789);

  int returned = object.passSimple(a_byte, 2, a_short, a_string, a_double);

  System.out.println("  Returned value " + returned);
  System.out.println("  Returned parameters: ");
  System.out.println("  octet " + a_byte.value);
  System.out.println("  short " + a_short.value);
  System.out.println("  string '" + a_string.value+"'");
  System.out.println("  double " + a_double.value);
}
项目:jvm-stm    文件:DemoServant.java   
/**
 * Accept and return parameters, having various types.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  System.out.println("SERVER: ***** Test passing multiple parameters");
  System.out.println("SERVER:   Received:");
  System.out.println("SERVER:   octet " + an_octet.value);
  System.out.println("SERVER:   short " + a_short.value);
  System.out.println("SERVER:   string " + a_string.value);

  // Returning incremented values.
  an_octet.value++;
  a_short.value++;

  // OUT parameter, return only.
  a_double.value = 1;
  a_string.value += " [return]";
  return 452572;
}
项目:jvm-stm    文件:DirectTest.java   
/**
 * Test passing multiple parameters in both directions.
 */
public void testParameters()
{
  System.out.println("***** Pass multiple parameters.");

  // Holder classes are required to simulate passing
  // "by reference" (modification is returned back to the server).
  ByteHolder a_byte = new ByteHolder((byte) 0);
  ShortHolder a_short = new ShortHolder((short) 3);
  StringHolder a_string = new StringHolder("[string 4]");

  // This is an 'out' parameter; the value must not be passed to servant.
  DoubleHolder a_double = new DoubleHolder(56.789);

  int returned = object.passSimple(a_byte, 2, a_short, a_string, a_double);

  System.out.println("  Returned value " + returned);
  System.out.println("  Returned parameters: ");
  System.out.println("  octet " + a_byte.value);
  System.out.println("  short " + a_short.value);
  System.out.println("  string '" + a_string.value+"'");
  System.out.println("  double " + a_double.value);
}
项目:JamVM-PH    文件:DemoServant.java   
/**
 * Accept and return parameters, having various types.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  System.out.println("SERVER: ***** Test passing multiple parameters");
  System.out.println("SERVER:   Received:");
  System.out.println("SERVER:   octet " + an_octet.value);
  System.out.println("SERVER:   short " + a_short.value);
  System.out.println("SERVER:   string " + a_string.value);

  // Returning incremented values.
  an_octet.value++;
  a_short.value++;

  // OUT parameter, return only.
  a_double.value = 1;
  a_string.value += " [return]";
  return 452572;
}
项目:JamVM-PH    文件:DirectTest.java   
/**
 * Test passing multiple parameters in both directions.
 */
public void testParameters()
{
  System.out.println("***** Pass multiple parameters.");

  // Holder classes are required to simulate passing
  // "by reference" (modification is returned back to the server).
  ByteHolder a_byte = new ByteHolder((byte) 0);
  ShortHolder a_short = new ShortHolder((short) 3);
  StringHolder a_string = new StringHolder("[string 4]");

  // This is an 'out' parameter; the value must not be passed to servant.
  DoubleHolder a_double = new DoubleHolder(56.789);

  int returned = object.passSimple(a_byte, 2, a_short, a_string, a_double);

  System.out.println("  Returned value " + returned);
  System.out.println("  Returned parameters: ");
  System.out.println("  octet " + a_byte.value);
  System.out.println("  short " + a_short.value);
  System.out.println("  string '" + a_string.value+"'");
  System.out.println("  double " + a_double.value);
}
项目:classpath    文件:DemoServant.java   
/**
 * Accept and return parameters, having various types.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  System.out.println("SERVER: ***** Test passing multiple parameters");
  System.out.println("SERVER:   Received:");
  System.out.println("SERVER:   octet " + an_octet.value);
  System.out.println("SERVER:   short " + a_short.value);
  System.out.println("SERVER:   string " + a_string.value);

  // Returning incremented values.
  an_octet.value++;
  a_short.value++;

  // OUT parameter, return only.
  a_double.value = 1;
  a_string.value += " [return]";
  return 452572;
}
项目:classpath    文件:DirectTest.java   
/**
 * Test passing multiple parameters in both directions.
 */
public void testParameters()
{
  System.out.println("***** Pass multiple parameters.");

  // Holder classes are required to simulate passing
  // "by reference" (modification is returned back to the server).
  ByteHolder a_byte = new ByteHolder((byte) 0);
  ShortHolder a_short = new ShortHolder((short) 3);
  StringHolder a_string = new StringHolder("[string 4]");

  // This is an 'out' parameter; the value must not be passed to servant.
  DoubleHolder a_double = new DoubleHolder(56.789);

  int returned = object.passSimple(a_byte, 2, a_short, a_string, a_double);

  System.out.println("  Returned value " + returned);
  System.out.println("  Returned parameters: ");
  System.out.println("  octet " + a_byte.value);
  System.out.println("  short " + a_short.value);
  System.out.println("  string '" + a_string.value+"'");
  System.out.println("  double " + a_double.value);
}
项目:javify    文件:gnuDynAny.java   
/** {@inheritDoc} */
public double get_double() throws TypeMismatch
{
  try
    {
      return ((DoubleHolder) holder).value;
    }
  catch (ClassCastException cex)
    {
      TypeMismatch m = new TypeMismatch();
      m.initCause(cex);
      throw m;
    }
}
项目:javify    文件:gnuDynAny.java   
/** {@inheritDoc} */
public void insert_double(double a_x) throws InvalidValue, TypeMismatch
{
  try
    {
      ((DoubleHolder) holder).value = a_x;
      valueChanged();
    }
  catch (ClassCastException cex)
    {
      TypeMismatch t = new TypeMismatch();
      t.initCause(cex);
      throw t;
    }
}
项目:javify    文件:gnuAny.java   
/** {@inheritDoc} */
public double extract_double()
                      throws BAD_OPERATION
{
  check(TCKind._tk_double);
  return ((DoubleHolder) has).value;
}
项目:jvm-stm    文件:gnuDynAny.java   
/** {@inheritDoc} */
public double get_double() throws TypeMismatch
{
  try
    {
      return ((DoubleHolder) holder).value;
    }
  catch (ClassCastException cex)
    {
      TypeMismatch m = new TypeMismatch();
      m.initCause(cex);
      throw m;
    }
}
项目:jvm-stm    文件:gnuDynAny.java   
/** {@inheritDoc} */
public void insert_double(double a_x) throws InvalidValue, TypeMismatch
{
  try
    {
      ((DoubleHolder) holder).value = a_x;
      valueChanged();
    }
  catch (ClassCastException cex)
    {
      TypeMismatch t = new TypeMismatch();
      t.initCause(cex);
      throw t;
    }
}
项目:jvm-stm    文件:gnuAny.java   
/** {@inheritDoc} */
public double extract_double()
                      throws BAD_OPERATION
{
  check(TCKind._tk_double);
  return ((DoubleHolder) has).value;
}
项目:JamVM-PH    文件:gnuDynAny.java   
/** {@inheritDoc} */
public double get_double() throws TypeMismatch
{
  try
    {
      return ((DoubleHolder) holder).value;
    }
  catch (ClassCastException cex)
    {
      TypeMismatch m = new TypeMismatch();
      m.initCause(cex);
      throw m;
    }
}
项目:JamVM-PH    文件:gnuDynAny.java   
/** {@inheritDoc} */
public void insert_double(double a_x) throws InvalidValue, TypeMismatch
{
  try
    {
      ((DoubleHolder) holder).value = a_x;
      valueChanged();
    }
  catch (ClassCastException cex)
    {
      TypeMismatch t = new TypeMismatch();
      t.initCause(cex);
      throw t;
    }
}
项目:JamVM-PH    文件:gnuAny.java   
/** {@inheritDoc} */
public double extract_double()
                      throws BAD_OPERATION
{
  check(TCKind._tk_double);
  return ((DoubleHolder) has).value;
}
项目:classpath    文件:gnuDynAny.java   
/** {@inheritDoc} */
public double get_double() throws TypeMismatch
{
  try
    {
      return ((DoubleHolder) holder).value;
    }
  catch (ClassCastException cex)
    {
      TypeMismatch m = new TypeMismatch();
      m.initCause(cex);
      throw m;
    }
}
项目:classpath    文件:gnuDynAny.java   
/** {@inheritDoc} */
public void insert_double(double a_x) throws InvalidValue, TypeMismatch
{
  try
    {
      ((DoubleHolder) holder).value = a_x;
      valueChanged();
    }
  catch (ClassCastException cex)
    {
      TypeMismatch t = new TypeMismatch();
      t.initCause(cex);
      throw t;
    }
}
项目:classpath    文件:gnuAny.java   
/** {@inheritDoc} */
public double extract_double()
                      throws BAD_OPERATION
{
  check(TCKind._tk_double);
  return ((DoubleHolder) has).value;
}
项目:javify    文件:_DemoTesterStub.java   
/**
 * Passes various parameters in both directions. The parameters that
 * shoud also return the values are wrapped into holders.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  InputStream in = null;
  try
    {
      // Get the stream where the parameters must be written:
      OutputStream out = _request("passSimple", true);

      // Write the parameters.
      out.write_octet(an_octet.value);
      out.write_long(a_long);
      out.write_short(a_short.value);
      out.write_string(a_string.value);

      // Invoke the method.
      in = _invoke(out);

      // Read the returned values.
      int result = in.read_long();

      // Read the inout and out parameters.
      an_octet.value = in.read_octet();
      a_short.value = in.read_short();
      a_string.value = in.read_string();
      a_double.value = in.read_double();
      return result;
    }
  catch (ApplicationException ex)
    {
      // Handle excepion on remote side.
      in = ex.getInputStream();
      throw new MARSHAL(ex.getId());
    }
  catch (RemarshalException _rm)
    {
      // Handle instruction to resend the parameters.
      return passSimple(an_octet, a_long, a_short, a_string, a_double);
    }
  finally
    {
      _releaseReply(in);
    }
}
项目:jvm-stm    文件:_DemoTesterStub.java   
/**
 * Passes various parameters in both directions. The parameters that
 * shoud also return the values are wrapped into holders.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  InputStream in = null;
  try
    {
      // Get the stream where the parameters must be written:
      OutputStream out = _request("passSimple", true);

      // Write the parameters.
      out.write_octet(an_octet.value);
      out.write_long(a_long);
      out.write_short(a_short.value);
      out.write_string(a_string.value);

      // Invoke the method.
      in = _invoke(out);

      // Read the returned values.
      int result = in.read_long();

      // Read the inout and out parameters.
      an_octet.value = in.read_octet();
      a_short.value = in.read_short();
      a_string.value = in.read_string();
      a_double.value = in.read_double();
      return result;
    }
  catch (ApplicationException ex)
    {
      // Handle excepion on remote side.
      in = ex.getInputStream();
      throw new MARSHAL(ex.getId());
    }
  catch (RemarshalException _rm)
    {
      // Handle instruction to resend the parameters.
      return passSimple(an_octet, a_long, a_short, a_string, a_double);
    }
  finally
    {
      _releaseReply(in);
    }
}
项目:JamVM-PH    文件:_DemoTesterStub.java   
/**
 * Passes various parameters in both directions. The parameters that
 * shoud also return the values are wrapped into holders.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  InputStream in = null;
  try
    {
      // Get the stream where the parameters must be written:
      OutputStream out = _request("passSimple", true);

      // Write the parameters.
      out.write_octet(an_octet.value);
      out.write_long(a_long);
      out.write_short(a_short.value);
      out.write_string(a_string.value);

      // Invoke the method.
      in = _invoke(out);

      // Read the returned values.
      int result = in.read_long();

      // Read the inout and out parameters.
      an_octet.value = in.read_octet();
      a_short.value = in.read_short();
      a_string.value = in.read_string();
      a_double.value = in.read_double();
      return result;
    }
  catch (ApplicationException ex)
    {
      // Handle excepion on remote side.
      in = ex.getInputStream();
      throw new MARSHAL(ex.getId());
    }
  catch (RemarshalException _rm)
    {
      // Handle instruction to resend the parameters.
      return passSimple(an_octet, a_long, a_short, a_string, a_double);
    }
  finally
    {
      _releaseReply(in);
    }
}
项目:classpath    文件:_DemoTesterStub.java   
/**
 * Passes various parameters in both directions. The parameters that
 * shoud also return the values are wrapped into holders.
 */
public int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
                      StringHolder a_string, DoubleHolder a_double
                     )
{
  InputStream in = null;
  try
    {
      // Get the stream where the parameters must be written:
      OutputStream out = _request("passSimple", true);

      // Write the parameters.
      out.write_octet(an_octet.value);
      out.write_long(a_long);
      out.write_short(a_short.value);
      out.write_string(a_string.value);

      // Invoke the method.
      in = _invoke(out);

      // Read the returned values.
      int result = in.read_long();

      // Read the inout and out parameters.
      an_octet.value = in.read_octet();
      a_short.value = in.read_short();
      a_string.value = in.read_string();
      a_double.value = in.read_double();
      return result;
    }
  catch (ApplicationException ex)
    {
      // Handle excepion on remote side.
      in = ex.getInputStream();
      throw new MARSHAL(ex.getId());
    }
  catch (RemarshalException _rm)
    {
      // Handle instruction to resend the parameters.
      return passSimple(an_octet, a_long, a_short, a_string, a_double);
    }
  finally
    {
      _releaseReply(in);
    }
}
项目:javify    文件:DemoTester.java   
/**
 * Passes various parameters in both directions.
 * The parameters that must return the value are wrapped in holders.
 */
int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
               StringHolder a_string, DoubleHolder a_double
              );
项目:jvm-stm    文件:DemoTester.java   
/**
 * Passes various parameters in both directions.
 * The parameters that must return the value are wrapped in holders.
 */
int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
               StringHolder a_string, DoubleHolder a_double
              );
项目:JamVM-PH    文件:DemoTester.java   
/**
 * Passes various parameters in both directions.
 * The parameters that must return the value are wrapped in holders.
 */
int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
               StringHolder a_string, DoubleHolder a_double
              );
项目:classpath    文件:DemoTester.java   
/**
 * Passes various parameters in both directions.
 * The parameters that must return the value are wrapped in holders.
 */
int passSimple(ByteHolder an_octet, int a_long, ShortHolder a_short,
               StringHolder a_string, DoubleHolder a_double
              );