RTI Connext Java API
Version 5.2.0
|
A sequence capable of storing its elements directly or taking out a loan on them from an internal middleware store. More...
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. | |
![]() | |
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. | |
![]() | |
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 () |
A sequence capable of storing its elements directly or taking out a loan on them from an internal middleware store.
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.
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.
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.
new_max | Must be >= 0. |
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.