JavaTM 2 Platform
Standard Ed. 6

org.omg.CORBA
类 AnyHolder

java.lang.Object
  继承者 org.omg.CORBA.AnyHolder
所有已实现的接口:
Streamable

public final class AnyHolder
extends Object
implements Streamable

Any 的 Holder。关于 Holder 文件的更多信息,请参阅“生成的文件:Holder 文件”

Any 对象的 Holder 类,用于存储 IDL 方法中的 "out" 和 "inout" 参数。如果 IDL 方法签名将 IDL any 作为 "out" 或 "inout" 参数,则程序员必须传递 AnyHolder 实例作为方法调用中的相应参数;对于 "inout" 参数,程序员还必须填充将发送到服务器的 "in" 值。在方法调用返回之前,ORB 将填充与从服务器返回的 "out" 值对应的值。

如果 myAnyHolderAnyHolder 的实例,则可以使用 myAnyHolder.value 访问存储在其 value 字段中的值。

从以下版本开始:
JDK1.2

字段摘要
 Any value
          此 AnyHolder 对象保存的 Any 值。
 
构造方法摘要
AnyHolder()
          构造一个新的 AnyHolder 对象,将其 value 字段初始化为 null
AnyHolder(Any initial)
          为给定的 Any 对象构造一个新 AnyHolder 对象。
 
方法摘要
 void _read(InputStream input)
          从 input 中读取数据,并使用已解组数据初始化 Holder 中的值。
 TypeCode _type()
          返回对应于此 AnyHolder 对象中保存值的 TypeCode 对象。
 void _write(OutputStream output)
          将此 AnyHolder 对象中的值编组到 output
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

value

public Any value
AnyHolder 对象保存的 Any 值。

构造方法详细信息

AnyHolder

public AnyHolder()
构造一个新的 AnyHolder 对象,将其 value 字段初始化为 null


AnyHolder

public AnyHolder(Any initial)
为给定的 Any 对象构造一个新 AnyHolder 对象。

参数:
initial - 用来初始化新 AnyHolder 对象 value 字段的 Any 对象
方法详细信息

_read

public void _read(InputStream input)
input 中读取数据,并使用已解组数据初始化 Holder 中的值。

指定者:
接口 Streamable 中的 _read
参数:
input - 包含从导线获取的 CDR 格式数据的 InputStream。

_write

public void _write(OutputStream output)
将此 AnyHolder 对象中的值编组到 output

指定者:
接口 Streamable 中的 _write
参数:
output - 将包含 CDR 格式数据的 OutputStream。

_type

public TypeCode _type()
返回对应于此 AnyHolder 对象中保存值的 TypeCode 对象。

指定者:
接口 Streamable 中的 _type
返回:
AnyHolder 对象中所保存值的 TypeCode

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only