activemq-cpp-3.6.0
decaf::lang::CharSequence Class Reference

A CharSequence is a readable sequence of char values. More...

#include <src/main/decaf/lang/CharSequence.h>

Inheritance diagram for decaf::lang::CharSequence:

Public Member Functions

virtual ~CharSequence ()
virtual int length () const =0
virtual char charAt (int index) const =0
 Returns the Char at the specified index so long as the index is not greater than the length of the sequence.
virtual CharSequencesubSequence (int start, int end) const =0
 Returns a new CharSequence that is a subsequence of this sequence.
virtual std::string toString () const =0

Detailed Description

A CharSequence is a readable sequence of char values.

This interface provides uniform, read-only access to many different kinds of char sequences.

This interface does not define that a CharSequence should implement comparable, it is therefore up to the dervied classes that implement this interface to define equality, which implies that comparison of two CharSequences does not have a contract on equality.

Constructor & Destructor Documentation

virtual decaf::lang::CharSequence::~CharSequence ( )
virtual

Member Function Documentation

virtual char decaf::lang::CharSequence::charAt ( int  index) const
pure virtual

Returns the Char at the specified index so long as the index is not greater than the length of the sequence.

Parameters
indexThe position to return the char at.
Returns
the char at the given position.
Exceptions
IndexOutOfBoundsExceptionif index is > than length() or negative

Implemented in decaf::nio::CharBuffer, and decaf::lang::String.

virtual int decaf::lang::CharSequence::length ( ) const
pure virtual
Returns
the length of the underlying character sequence.

Implemented in decaf::nio::CharBuffer, and decaf::lang::String.

virtual CharSequence* decaf::lang::CharSequence::subSequence ( int  start,
int  end 
) const
pure virtual

Returns a new CharSequence that is a subsequence of this sequence.

The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in chars) of the returned sequence is end - start, so if start == end then an empty sequence is returned.

Parameters
startThe start index, inclusive.
endThe end index, exclusive.
Returns
a new CharSequence
Exceptions
IndexOutOfBoundsExceptionif start or end > length() or start or end are negative.

Implemented in decaf::nio::CharBuffer, decaf::internal::nio::CharArrayBuffer, and decaf::lang::String.

virtual std::string decaf::lang::CharSequence::toString ( ) const
pure virtual
Returns
the string representation of this CharSequence

Implemented in decaf::lang::String, and decaf::nio::CharBuffer.


The documentation for this class was generated from the following file: