RTI Connext Java API  Version 5.0.0
Sample< T >.Iterator< T > Interface Reference

Provides access to a collection of middleware-loaned samples. More...

Inherits ListIterator< Sample< T > >, and Closeable.

Public Member Functions

int size ()
 Returns the number of samples.
 
boolean hasNext ()
 
Sample< T > next ()
 
boolean hasPrevious ()
 
Sample< T > previous ()
 
int nextIndex ()
 
int previousIndex ()
 
void remove ()
 
void set (Sample< T > o)
 
void add (Sample< T > o)
 
void close ()
 Returns the loaned samples to the middleware.
 

Detailed Description

Provides access to a collection of middleware-loaned samples.

The samples in this container are loaned from the middleware and must be returned at some point.

To return the loan, use close() , from java.io.Closeable or (since Java 7) enclose this object within a try-with-resources block (see Taking loaned samples).

Alternatively, if the loan is not returned by the application code, it will be automatically returned when this object is garbage-collected.

The contents of this container should not be modified and references to the samples it contains are only valid before the loan is returned.

This interface extends java.util.ListIterator<Sample<T>>. However any operations that modify the underlying list are not supported.

Template Parameters
TThe data type of the contained Samples
See Also
com.rti.connext.requestreply.Requester<TReq,TRep>.takeReplies(int)
com.rti.connext.requestreply.Replier<TReq,TRep>.takeRequests(int)
Taking loaned samples
Taking samples by copy

Member Function Documentation

int size ( )

Returns the number of samples.

boolean hasNext ( )

From java.util.ListIterator<Sample<T>>

Sample<T> next ( )

From java.util.ListIterator<Sample<T>>

boolean hasPrevious ( )

From java.util.ListIterator<Sample<T>>

Sample<T> previous ( )

From java.util.ListIterator<Sample<T>>

int nextIndex ( )

From java.util.ListIterator<Sample<T>>

int previousIndex ( )

From java.util.ListIterator<Sample<T>>

void remove ( )
Exceptions
UnsupportedOperationExceptionalways.
void set ( Sample< T >  o)
Exceptions
UnsupportedOperationExceptionalways.
void add ( Sample< T >  o)
Exceptions
UnsupportedOperationExceptionalways.
void close ( )

Returns the loaned samples to the middleware.

After calling this operation this object cannot be accessed again.

See Also
com.rti.ndds.example.FooDataReader.return_loan (for more information on how the middleware loans samples)

RTI Connext Java API Version 5.0.0 Copyright © Thu Aug 30 2012 Real-Time Innovations, Inc