APIdia Launch Partner
Top Description Constructors Methods
java.nio

pack-priv final Class HeapDoubleBufferR

extends HeapDoubleBuffer
Class Inheritance
Imports
java.lang.foreign.MemorySegment, jdk.internal.foreign.AbstractMemorySegmentImpl, .MemorySessionImpl, .SegmentFactories, jdk.internal.vm.annotation.ForceInline, java.util.Objects

A read-only HeapDoubleBuffer. This class extends the corresponding read/write class, overriding the mutation methods to throw a ReadOnlyBufferException and overriding the view-buffer methods to return an instance of this class rather than of the superclass.

Constructor Summary

AccessConstructor and Description
pack-priv
HeapDoubleBufferR(int cap, int lim, MemorySegment segment)

pack-priv
HeapDoubleBufferR(double[] buf, int off, int len, MemorySegment segment)

protected
HeapDoubleBufferR(double[] buf, int mark, int pos, int lim, int cap, int off, MemorySegment segment)

Method Summary

Modifier and TypeMethod and Description
public DoubleBuffer
asReadOnlyBuffer()

Overrides java.nio.HeapDoubleBuffer.asReadOnlyBuffer.

Creates a new, read-only double buffer that shares this buffer's content.

public DoubleBuffer
compact()

Overrides java.nio.HeapDoubleBuffer.compact.

Compacts this buffer  (optional operation).

public DoubleBuffer
duplicate()

Overrides java.nio.HeapDoubleBuffer.duplicate.

Creates a new double buffer that shares this buffer's content.

public boolean
isReadOnly()

Overrides java.nio.HeapDoubleBuffer.isReadOnly.

Tells whether or not this buffer is read-only.

public ByteOrder
order()

Overrides java.nio.HeapDoubleBuffer.order.

Retrieves this buffer's byte order.

public DoubleBuffer
put(double x)

Overrides java.nio.HeapDoubleBuffer.put.

Relative put method  (optional operation).

public DoubleBuffer
put(int i, double x)

Overrides java.nio.HeapDoubleBuffer.put.

Absolute put method  (optional operation).

public DoubleBuffer
put(double[] src, int offset, int length)

Overrides java.nio.HeapDoubleBuffer.put.

Relative bulk put method  (optional operation).

public DoubleBuffer
put(DoubleBuffer src)

Overrides java.nio.HeapDoubleBuffer.put.

Relative bulk put method  (optional operation).

public DoubleBuffer
put(int index, DoubleBuffer src, int offset, int length)

Overrides java.nio.HeapDoubleBuffer.put.

Absolute bulk put method  (optional operation).

public DoubleBuffer
put(int index, double[] src, int offset, int length)

Overrides java.nio.HeapDoubleBuffer.put.

Absolute bulk put method  (optional operation).

public DoubleBuffer
slice()

Overrides java.nio.HeapDoubleBuffer.slice.

Creates a new double buffer whose content is a shared subsequence of this buffer's content.

public DoubleBuffer
slice(int index, int length)

Overrides java.nio.HeapDoubleBuffer.slice.

Creates a new double buffer whose content is a shared subsequence of this buffer's content.

Inherited from java.nio.HeapDoubleBuffer:
getgetgetgetisDirectix

Constructor Detail

HeapDoubleBufferRback to summary
pack-priv HeapDoubleBufferR(int cap, int lim, MemorySegment segment)
HeapDoubleBufferRback to summary
pack-priv HeapDoubleBufferR(double[] buf, int off, int len, MemorySegment segment)
HeapDoubleBufferRback to summary
protected HeapDoubleBufferR(double[] buf, int mark, int pos, int lim, int cap, int off, MemorySegment segment)

Method Detail

asReadOnlyBufferback to summary
public DoubleBuffer asReadOnlyBuffer()

Overrides java.nio.HeapDoubleBuffer.asReadOnlyBuffer.

Doc from java.nio.DoubleBuffer.asReadOnlyBuffer.

Creates a new, read-only double 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.

The new buffer's capacity, limit, position, mark values, and byte order will be identical to those of this buffer.

If this buffer is itself read-only then this method behaves in exactly the same way as the duplicate method.

compactback to summary
public DoubleBuffer compact()

Overrides java.nio.HeapDoubleBuffer.compact.

Doc from java.nio.DoubleBuffer.compact.

Compacts this buffer  (optional operation).

The doubles between the buffer's current position and its limit, if any, are copied to the beginning of the buffer. That is, the double at index p = position() is copied to index zero, the double at index p + 1 is copied to index one, and so forth until the double 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 doubles copied, rather than to zero, so that an invocation of this method can be followed immediately by an invocation of another relative put method.

duplicateback to summary
public DoubleBuffer duplicate()

Overrides java.nio.HeapDoubleBuffer.duplicate.

Doc from java.nio.DoubleBuffer.duplicate.

Creates a new double 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, mark values, and byte order will be identical to those of this buffer. The new buffer will be direct if, and only if, this buffer is direct, and it will be read-only if, and only if, this buffer is read-only.

isReadOnlyback to summary
public boolean isReadOnly()

Overrides java.nio.HeapDoubleBuffer.isReadOnly.

Doc from java.nio.Buffer.isReadOnly.

Tells whether or not this buffer is read-only.

orderback to summary
public ByteOrder order()

Overrides java.nio.HeapDoubleBuffer.order.

Doc from java.nio.DoubleBuffer.order.

Retrieves this buffer's byte order.

The byte order of a double buffer created by allocation or by wrapping an existing double array is the native order of the underlying hardware. The byte order of a double buffer created as a view of a byte buffer is that of the byte buffer at the moment that the view is created.

putback to summary
public DoubleBuffer put(double x)

Overrides java.nio.HeapDoubleBuffer.put.

Doc from java.nio.DoubleBuffer.put.

Relative put method  (optional operation).

Writes the given double into this buffer at the current position, and then increments the position.

putback to summary
public DoubleBuffer put(int i, double x)

Overrides java.nio.HeapDoubleBuffer.put.

Doc from java.nio.DoubleBuffer.put.

Absolute put method  (optional operation).

Writes the given double into this buffer at the given index.

putback to summary
public DoubleBuffer put(double[] src, int offset, int length)

Overrides java.nio.HeapDoubleBuffer.put.

Doc from java.nio.DoubleBuffer.put.

Relative bulk put method  (optional operation).

This method transfers doubles into this buffer from the given source array. If there are more doubles to be copied from the array than remain in this buffer, that is, if length > remaining(), then no doubles are transferred and a BufferOverflowException is thrown.

Otherwise, this method copies length doubles from the given array into this buffer, starting at the given offset in the array and at the current position of this buffer. The position of this buffer is then incremented by length.

In other words, an invocation of this method of the form dst.put(src, off, len) has exactly the same effect as the loop

for (int i = off; i < off + len; i++) dst.put(src[i]);
for (int i = off; i < off + len; i++)
    dst.put(src[i]);
except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient.
putback to summary
public DoubleBuffer put(DoubleBuffer src)

Overrides java.nio.HeapDoubleBuffer.put.

Doc from java.nio.DoubleBuffer.put.

Relative bulk put method  (optional operation).

This method transfers the doubles remaining in the given source buffer into this buffer. If there are more doubles remaining in the source buffer than in this buffer, that is, if src.remaining() > remaining(), then no doubles are transferred and a BufferOverflowException is thrown.

Otherwise, this method copies n = src.remaining() doubles from the given buffer into this buffer, starting at each buffer's current position. The positions of both buffers are then incremented by n.

In other words, an invocation of this method of the form dst.put(src) has exactly the same effect as the loop

while (src.hasRemaining()) dst.put(src.get());
while (src.hasRemaining())
    dst.put(src.get());
except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient. If this buffer and the source buffer share the same backing array or memory, then the result will be as if the source elements were first copied to an intermediate location before being written into this buffer.
putback to summary
public DoubleBuffer put(int index, DoubleBuffer src, int offset, int length)

Overrides java.nio.HeapDoubleBuffer.put.

Doc from java.nio.DoubleBuffer.put.

Absolute bulk put method  (optional operation).

This method transfers length doubles into this buffer from the given source buffer, starting at the given offset in the source buffer and the given index in this buffer. The positions of both buffers are unchanged.

In other words, an invocation of this method of the form dst.put(index, src, offset, length) has exactly the same effect as the loop

for (int i = offset, j = index; i < offset + length; i++, j++) dst.put(j, src.get(i));
for (int i = offset, j = index; i < offset + length; i++, j++)
    dst.put(j, src.get(i));
except that it first checks the consistency of the supplied parameters and it is potentially much more efficient. If this buffer and the source buffer share the same backing array or memory, then the result will be as if the source elements were first copied to an intermediate location before being written into this buffer.
putback to summary
public DoubleBuffer put(int index, double[] src, int offset, int length)

Overrides java.nio.HeapDoubleBuffer.put.

Doc from java.nio.DoubleBuffer.put.

Absolute bulk put method  (optional operation).

This method transfers length doubles from the given array, starting at the given offset in the array and at the given index in this buffer. The position of this buffer is unchanged.

An invocation of this method of the form dst.put(index, src, offset, length) has exactly the same effect as the following loop except that it first checks the consistency of the supplied parameters and it is potentially much more efficient:

for (int i = offset, j = index; i < offset + length; i++, j++) dst.put(j, src[i]);
for (int i = offset, j = index; i < offset + length; i++, j++)
    dst.put(j, src[i]);
sliceback to summary
public DoubleBuffer slice()

Overrides java.nio.HeapDoubleBuffer.slice.

Doc from java.nio.DoubleBuffer.slice.

Creates a new double buffer 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 doubles remaining in this buffer, its mark will be undefined, and its byte order will be identical to that of this buffer. The new buffer will be direct if, and only if, this buffer is direct, and it will be read-only if, and only if, this buffer is read-only.

sliceback to summary
public DoubleBuffer slice(int index, int length)

Overrides java.nio.HeapDoubleBuffer.slice.

Doc from java.nio.DoubleBuffer.slice.

Creates a new double buffer whose content is a shared subsequence of this buffer's content.

The content of the new buffer will start at position index in this buffer, and will contain length elements. 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 length, its mark will be undefined, and its byte order will be identical to that of this buffer. The new buffer will be direct if, and only if, this buffer is direct, and it will be read-only if, and only if, this buffer is read-only.

Annotations
@Override