Public Member Functions |
| IntArrayBuffer (int size, bool readOnly=false) |
| Creates a IntArrayBuffer object that has its backing array allocated internally and is then owned and deleted when this object is deleted.
|
| IntArrayBuffer (int *array, int size, int offset, int length, bool readOnly=false) |
| Creates a IntArrayBuffer object that wraps the given array.
|
| IntArrayBuffer (const decaf::lang::Pointer< ByteArrayAdapter > &array, int offset, int length, bool readOnly=false) |
| Creates a byte buffer that wraps the passed ByteArrayAdapter and start at the given offset.
|
| IntArrayBuffer (const IntArrayBuffer &other) |
| Create a IntArrayBuffer that mirrors this one, meaning it shares a reference to this buffers ByteArrayAdapter and when changes are made to that data it is reflected in both.
|
virtual | ~IntArrayBuffer () |
virtual int * | array () |
| Returns the int array that backs this buffer (optional operation).Modifications to this buffer's content will cause the returned array's content to be modified, and vice versa.Invoke the hasArray method before invoking this method in order to ensure that this buffer has an accessible backing array.- Returns
- the array that backs this Buffer.
- Exceptions
-
|
virtual int | arrayOffset () |
| Returns the offset within this buffer's backing array of the first element of the buffer (optional operation).Invoke the hasArray method before invoking this method in order to ensure that this buffer has an accessible backing array.- Returns
- The offset into the backing array where index zero starts.
- Exceptions
-
|
virtual IntBuffer * | asReadOnlyBuffer () const |
| Creates a new, read-only int buffer that shares this buffer's content.The content of the new buffer will be that of this buffer. Changes to this buffer's content will be visible in the new buffer; the new buffer itself, however, will be read-only and will not allow the shared content to be modified. The two buffers' position, limit, and mark values will be independent.If this buffer is itself read-only then this method behaves in exactly the same way as the duplicate method.The new buffer's capacity, limit, position, and mark values will be identical to those of this buffer.- Returns
- The new, read-only int buffer which the caller then owns.
|
virtual IntBuffer & | compact () |
| Compacts this buffer.The bytes between the buffer's current position and its limit, if any, are copied to the beginning of the buffer. That is, the byte at index p = position() is copied to index zero, the byte at index p + 1 is copied to index one, and so forth until the byte at index limit() - 1 is copied to index n = limit() - 1 - p. The buffer's position is then set to n+1 and its limit is set to its capacity. The mark, if defined, is discarded.The buffer's position is set to the number of bytes copied, rather than to zero, so that an invocation of this method can be followed immediately by an invocation of another relative put method.- Returns
- a reference to this IntBuffer
- Exceptions
-
|
virtual IntBuffer * | duplicate () |
| Creates a new int buffer that shares this buffer's content.The content of the new buffer will be that of this buffer. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's capacity, limit, position, and mark values will be identical to those of this buffer. The new buffer will be read-only if, and only if, this buffer is read-only.- Returns
- a new int Buffer which the caller owns.
|
virtual int | get () |
| Relative get method.Reads the value at this buffer's current position, and then increments the position.- Returns
- the int at the current position.
- Exceptions
-
|
virtual int | get (int index) const |
| Absolute get method.Reads the value at the given index.- Parameters
-
index | The index in the Buffer where the int is to be read. |
- Returns
- the int that is located at the given index.
- Exceptions
-
IndexOutOfBoundsException | if index is not smaller than the buffer's limit, or index is negative. |
|
virtual bool | hasArray () const |
| Tells whether or not this buffer is backed by an accessible int array.If this method returns true then the array and arrayOffset methods may safely be invoked. Subclasses should override this method if they do not have a backing array as this class always returns true.- Returns
- true if, and only if, this buffer is backed by an array and is not read-only.
|
virtual bool | isReadOnly () const |
| Tells whether or not this buffer is read-only.- Returns
- true if, and only if, this buffer is read-only.
|
virtual IntBuffer & | put (int value) |
| Writes the given integer into this buffer at the current position, and then increments the position.- Parameters
-
value | The integer value to be written. |
- Returns
- a reference to this buffer.
- Exceptions
-
|
virtual IntBuffer & | put (int index, int value) |
| Writes the given ints into this buffer at the given index.- Parameters
-
index | The position in the Buffer to write the data. |
value | The ints to write. |
- Returns
- a reference to this buffer.
- Exceptions
-
IndexOutOfBoundsException | - If index greater than the buffer's limit minus the size of the type being written, or the index is negative. |
ReadOnlyBufferException | - If this buffer is read-only. |
|
virtual IntBuffer * | slice () const |
| Creates a new IntBuffer whose content is a shared subsequence of this buffer's content.The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer, and its mark will be undefined. The new buffer will be read-only if, and only if, this buffer is read-only.- Returns
- the newly create IntBuffer which the caller owns.
|
virtual | ~IntBuffer () |
virtual std::string | toString () const |
IntBuffer & | get (std::vector< int > buffer) |
| Relative bulk get method.
|
IntBuffer & | get (int *buffer, int size, int offset, int length) |
| Relative bulk get method.
|
IntBuffer & | put (IntBuffer &src) |
| This method transfers the ints remaining in the given source buffer into this buffer.
|
IntBuffer & | put (const int *buffer, int size, int offset, int length) |
| This method transfers ints into this buffer from the given source array.
|
IntBuffer & | put (std::vector< int > &buffer) |
| This method transfers the entire content of the given source ints array into this buffer.
|
virtual int | compareTo (const IntBuffer &value) const |
|
|
virtual bool | equals (const IntBuffer &value) const |
|
|
virtual bool | operator== (const IntBuffer &value) const |
|
|
virtual bool | operator< (const IntBuffer &value) const |
|
|
| Buffer (int capactiy) |
| Buffer (const Buffer &other) |
virtual | ~Buffer () |
virtual int | capacity () const |
virtual int | position () const |
virtual Buffer & | position (int newPosition) |
| Sets this buffer's position.
|
virtual int | limit () const |
virtual Buffer & | limit (int newLimit) |
| Sets this buffer's limit.
|
virtual Buffer & | mark () |
| Sets this buffer's mark at its position.
|
virtual Buffer & | reset () |
| Resets this buffer's position to the previously-marked position.
|
virtual Buffer & | clear () |
| Clears this buffer.
|
virtual Buffer & | flip () |
| Flips this buffer.
|
virtual Buffer & | rewind () |
| Rewinds this buffer.
|
virtual int | remaining () const |
| Returns the number of elements between the current position and the limit.
|
virtual bool | hasRemaining () const |
| Tells whether there are any elements between the current position and the limit.
|
virtual | ~Comparable () |
virtual int | compareTo (const IntBuffer &value) const =0 |
| Compares this object with the specified object for order.
|
virtual bool | equals (const IntBuffer &value) const =0 |
virtual bool | operator== (const IntBuffer &value) const =0 |
| Compares equality between this object and the one passed.
|
virtual bool | operator< (const IntBuffer &value) const =0 |
| Compares this object to another and returns true if this object is considered to be less than the one passed.
|