RTI Connext Java API  Version 5.1.0
LoanableSequence Class Reference

A sequence capable of storing its elements directly or taking out a loan on them from an internal middleware store. More...

Inheritance diagram for LoanableSequence:
AbstractSequence Sequence SampleInfoSeq BytesSeq KeyedBytesSeq KeyedStringSeq FooSeq

Public Member Functions

 LoanableSequence (Class elementType)
 Construct a new sequence for elements of the given type.
 
 LoanableSequence (Class elementType, int maximum)
 Construct a new sequence for elements of the given type.
 
 LoanableSequence (Class elementType, Collection elements)
 Construct a new sequence for elements of the given type.
 
final boolean hasOwnership ()
 Return the value of the owned flag.
 
int getMaximum ()
 Get the current maximum number of elements that can be stored in this sequence.
 
void setMaximum (int new_max)
 Resize this sequence to a new desired maximum.
 
Object set (int index, Object element)
 Replaces the element at the specified position in this sequence with the specified element.
 
Object get (int index)
 Returns the element at the specified position in this sequence.
 
int size ()
 Returns the length of the sequence.
 
- Public Member Functions inherited from AbstractSequence
void add (int index, Object element)
 Inserts the specified element at the specified position in this sequence.
 
boolean add (Object element)
 Appends the specified element to the end of this sequence.
 
final Object remove (int index)
 Remove the element at the given index by shifting all subsequent elements "left" by one.
 
- Public Member Functions inherited from Sequence
int getMaximum ()
 Get the current maximum number of elements that can be stored in this sequence.
 
void setMaximum (int new_max)
 Resize this sequence to a new desired maximum.
 
Class getElementType ()
 

Detailed Description

A sequence capable of storing its elements directly or taking out a loan on them from an internal middleware store.

See Also
com.rti.dds.subscription.DataReader::read_untyped(java.util.List, com.rti.dds.subscription.SampleInfoSeq, int, int, int, int)
com.rti.dds.subscription.DataReader::take_untyped(java.util.List, com.rti.dds.subscription.SampleInfoSeq, int, int, int, int)

Constructor & Destructor Documentation

LoanableSequence ( Class  elementType)

Construct a new sequence for elements of the given type.

LoanableSequence ( Class  elementType,
int  maximum 
)

Construct a new sequence for elements of the given type.

LoanableSequence ( Class  elementType,
Collection  elements 
)

Construct a new sequence for elements of the given type.

Member Function Documentation

final boolean hasOwnership ( )

Return the value of the owned flag.

Returns
com.rti.dds.infrastructure.true if sequence owns the underlying buffer, or com.rti.dds.infrastructure.false if it has an outstanding loan.
int getMaximum ( )

Get the current maximum number of elements that can be stored in this sequence.

The maximum of the sequence represents the maximum number of elements that the underlying buffer can hold. It does not represent the current number of elements.

The maximum is a non-negative number. It is initialized when the sequence is first created.

The maximum can be changed implicitly by adding an element to the sequence with add(), or explicitly by calling com.rti.dds.infrastructure.com.rti.dds.util.Sequence.Sequence.setMaximum.

Returns
the current maximum of the sequence.
See Also
com.rti.dds.infrastructure.com.rti.dds.util.Sequence.Sequence.size()
void setMaximum ( int  new_max)

Resize this sequence to a new desired maximum.

This operation does nothing if the new desired maximum matches the current maximum.

Note: If you add an element with add(), the sequence's size is increased implicitly.

Postcondition
length == MINIMUM(original length, new_max)
Parameters
new_maxMust be >= 0.
Returns
com.rti.dds.infrastructure.true on success, com.rti.dds.infrastructure.false if the preconditions are not met. In that case the sequence is not modified.
Object set ( int  index,
Object  element 
)

Replaces the element at the specified position in this sequence with the specified element.

See Also
java.util.List::set(int, java.lang.Object)
Object get ( int  index)

Returns the element at the specified position in this sequence.

See Also
java.util.List::get(int)
int size ( )

Returns the length of the sequence.

See Also
java.util.List::get(int)

RTI Connext Java API Version 5.1.0 Copyright © Mon Feb 3 2014 Real-Time Innovations, Inc