Copyable Interface Reference
[Object Support]

<<eXtension>> <<interface>> Interface for all the user-defined data type classes that support copy. More...

Inheritance diagram for Copyable:

DynamicData InstanceHandle_t StringSeq SampleInfo BuiltinTopicKey_t Bytes BytesSeq KeyedBytes KeyedBytesSeq KeyedString KeyedStringSeq AbstractPrimitiveSequence Enum Foo FooSeq

List of all members.

Public Member Functions

Object copy_from (Object src)
 Copy value of a data type from source.


Detailed Description

<<eXtension>> <<interface>> Interface for all the user-defined data type classes that support copy.

A class implements the com.rti.dds.infrastructure.Copyable interface to indicate that it allows its entire state to be replaced with the state of another object. This state copy is a deep copy, such that subsequent changes to any part of one object will not be observed in the other.

Therefore, in general, object references in this object cannot simply be reassigned to those in the source object. (Strings are an exception to this rule, because they are immutable.)


Member Function Documentation

Object copy_from ( Object  src  ) 

Copy value of a data type from source.

Copy data into this object from another. This copy is intended to be a deep copy, so that all data members (recursively) are copied (not just resetting Object references).

This operation returns the object that is copied if copy is successful.

Parameters:
src <<in>> The Object which contains the data to be copied.
Returns:
Generally, return this but special cases (such as Enum) exist.
Exceptions:
NullPointerException If src is null.
ClassCastException If src is not the same type as this.

Implemented in DynamicData, InstanceHandle_t, StringSeq, SampleInfo, BuiltinTopicKey_t, Bytes, BytesSeq, KeyedBytes, KeyedBytesSeq, KeyedString, KeyedStringSeq, AbstractPrimitiveSequence, Enum, Foo, and FooSeq.


RTI Connext Java API Version 4.5f Copyright © 17 Mar 2012 Real-Time Innovations, Inc