ShortSeq Class Reference
[Built-in Sequences]

Instantiates com.rti.dds.util.Sequence < short >. More...

Inheritance diagram for ShortSeq:

AbstractPrimitiveSequence AbstractSequence Sequence Copyable Sequence

List of all members.

Public Member Functions

 ShortSeq ()
 Constructs an empty sequence of short integers with an initial maximum of zero.
 ShortSeq (int initialMaximum)
 Constructs an empty sequence of short integers with the given initial maximum.
 ShortSeq (short[] shorts)
 Constructs a new sequence containing the given shorts.
boolean addAllShort (short[] elements, int offset, int length)
 Append length elements from the given array to this sequence, starting at index offset in that array.
boolean addAllShort (short[] elements)
void addShort (short element)
 Append the element to the end of the sequence.
void addShort (int index, short element)
 Shift all elements in the sequence starting from the given index and add the element to the given index.
short getShort (int index)
 Returns the short at the given index.
short setShort (int index, short element)
 Set the new short at the given index and return the old short.
void setShort (int dstIndex, short[] elements, int srcIndex, int length)
 Copy a portion of the given array into this sequence.
short[] toArrayShort (short[] array)
 Return an array containing copy of the contents of this sequence.
int getMaximum ()
 Get the current maximum number of elements that can be stored in this sequence.
Object get (int index)
 A wrapper for getShort(int) that returns a java.lang.Short.
Object set (int index, Object element)
 A wrapper for setShort().
void add (int index, Object element)
 A wrapper for addShort(int, int).


Detailed Description

Instantiates com.rti.dds.util.Sequence < short >.

Instantiates:
<<generic>> com.rti.dds.util.Sequence
See also:
short

com.rti.dds.util.Sequence


Constructor & Destructor Documentation

ShortSeq (  ) 

Constructs an empty sequence of short integers with an initial maximum of zero.

ShortSeq ( int  initialMaximum  ) 

Constructs an empty sequence of short integers with the given initial maximum.

ShortSeq ( short[]  shorts  ) 

Constructs a new sequence containing the given shorts.

Parameters:
shorts the initial contents of this sequence
Exceptions:
NullPointerException if the input array is null


Member Function Documentation

boolean addAllShort ( short[]  elements,
int  offset,
int  length 
)

Append length elements from the given array to this sequence, starting at index offset in that array.

Exceptions:
NullPointerException if the given array is null.

boolean addAllShort ( short[]  elements  ) 

Exceptions:
NullPointerException if the given array is null

void addShort ( short  element  ) 

Append the element to the end of the sequence.

void addShort ( int  index,
short  element 
)

Shift all elements in the sequence starting from the given index and add the element to the given index.

short getShort ( int  index  ) 

Returns the short at the given index.

Exceptions:
IndexOutOfBoundsException if the index is out of bounds.

short setShort ( int  index,
short  element 
)

Set the new short at the given index and return the old short.

Exceptions:
IndexOutOfBoundsException if the index is out of bounds.

void setShort ( int  dstIndex,
short[]  elements,
int  srcIndex,
int  length 
)

Copy a portion of the given array into this sequence.

Parameters:
dstIndex the index at which to start copying into this sequence.
elements an array of primitive elements.
srcIndex the index at which to start copying from the given array.
length the number of elements to copy.
Exceptions:
IndexOutOfBoundsException if copying would cause access of data outside array bounds.

short [] toArrayShort ( short[]  array  ) 

Return an array containing copy of the contents of this sequence.

Parameters:
array The array into which this sequence should be copied. It may be null. If it is, or if array length is too small, the array will be ignored, and a new array of the necessary length will be created and copied into instead.
Returns:
A non-null array containing a copy of the contents of this sequence.

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 Sequence.setMaximum.

Returns:
the current maximum of the sequence.
See also:
Sequence.size()

Implements Sequence.

Object get ( int  index  )  [virtual]

A wrapper for getShort(int) that returns a java.lang.Short.

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

Implements AbstractPrimitiveSequence.

Object set ( int  index,
Object  element 
) [virtual]

A wrapper for setShort().

Exceptions:
ClassCastException if the element is not of type Short.
See also:
java.util.List.set(int, java.lang.Object)

Implements AbstractPrimitiveSequence.

void add ( int  index,
Object  element 
) [virtual]

A wrapper for addShort(int, int).

Exceptions:
ClassCastException if the element is not of type Short.
See also:
java.util.List.add(int, java.lang.Object)

Implements AbstractPrimitiveSequence.


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