本文整理汇总了Java中com.sun.squawk.VM.shallowCopy方法的典型用法代码示例。如果您正苦于以下问题:Java VM.shallowCopy方法的具体用法?Java VM.shallowCopy怎么用?Java VM.shallowCopy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.squawk.VM
的用法示例。
在下文中一共展示了VM.shallowCopy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1:
import com.sun.squawk.VM; //导入方法依赖的package包/类
/**
* The copy() method is similar to Object.clone() in j2se, but the original envelope is
* "owned" by the sending isolate, and the copy will be "owned" by the receiving isolate.
*
* The default Envelope.copy() method creates a new envelope of the actual type of
* "this", and performs a shallow copy of the entire envelope.
*
* Note that all subclasses must be certain that the copy does not contain any direct pointers to objects
* from the sender's Isolate
*
* The copy() method itself should be careful not to store pointers to either the original or copied
* object in static variables or any in other data structure. It's not defined which isolate will
* execute the copy() method.
*
* Called by the system once per Envelope, sometime between when the message is sent by send(),
* and when it is received by receive().
*
* @return a copy of this Envelope
*/
/* package-private*/ Envelope copy() {
// note that this does NOT call a contructor - and neither does Object.clone() as far as I can tell.
Envelope newEnv = (Envelope)VM.shallowCopy(this);
return newEnv;
}