FooSeq Class Reference
[Sequence Support]

<<interface>> <<generic>> A type-safe, ordered collection of elements. The type of these elements is referred to in this documentation as Foo. More...

Inheritance diagram for FooSeq:

LoanableSequence Sequence Copyable AbstractSequence Sequence

List of all members.

Public Member Functions

Object copy_from (Object src)

Package Attributes

Sequence _loanedInfoSequence = null


Detailed Description

<<interface>> <<generic>> A type-safe, ordered collection of elements. The type of these elements is referred to in this documentation as Foo.

For users who define data types in OMG IDL, this type corresponds to the IDL express sequence<Foo>.

For any user-data type Foo that an application defines for the purpose of data-distribution with RTI Connext, a FooSeq is generated. We refer to an IDL sequence<Foo> as FooSeq.

A sequence is a type-safe List that makes a distinction between its allocated size and its logical size (much like the ArrayList class). The Collection.size() method returns the logical size.

A new sequence is created for elements of a particular Class, which does not change throughout the lifetime of a sequence instance.

To add an element to a sequence, use the add() method inherited from the standard interface java.util.List; this will implicitly increase the sequence's size. Or, to pre-allocate space for several elements at once, use Sequence.setMaximum.

An attempt to add an element to a sequence that is not of the correct element type will result in a ClassCastException. (Note that null is considered to belong to any type.)

See also:
com.rti.dds.topic.example.FooDataWriter, com.rti.dds.topic.example.FooDataReader, com.rti.dds.topic.example.FooTypeSupport, rtiddsgen

Member Function Documentation

Object copy_from ( Object  src  ) 

Copy data into this object from another. The result of this method is that both this and src will be the same size and contain the same data.

Parameters:
src The Object which contains the data to be copied
Returns:
this
Exceptions:
NullPointerException If src is null.
ClassCastException If src is not a Sequence OR if one of the objects contained in the Sequence is not of the expected type.
See also:
com.rti.dds.infrastructure.Copyable.copy_from(java.lang.Object)

Implements Copyable.


Member Data Documentation

Sequence _loanedInfoSequence = null [package]

When a memory loan has been taken out in the lower layers of NDDS, store a pointer to the native sequence here. That way, when we call finish(), we can give the memory back.


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