public class MemoryRegionR extends MemoryRegion
| Constructor and Description |
|---|
MemoryRegionR(Memory memory,
long memOffsetBytes,
long capacityBytes,
MemoryRequest memReq) |
| Modifier and Type | Method and Description |
|---|---|
int |
addAndGetInt(long offsetBytes,
int delta)
Atomically adds the given value to the integer located at offsetBytes.
|
long |
addAndGetLong(long offsetBytes,
long delta)
Atomically adds the given value to the long located at offsetBytes.
|
Object |
array()
Returns the backing on-heap primitive array if there is one, otherwise returns null
|
ByteBuffer |
byteBuffer()
Returns the backing ByteBuffer if there is one, otherwise returns null
|
void |
clear()
Clears all bytes of this Memory to zero
|
void |
clear(long offsetBytes,
long lengthBytes)
Clears a portion of this Memory to zero.
|
void |
clearBits(long offsetBytes,
byte bitMask)
Clears the bits defined by the bitMask
|
boolean |
compareAndSwapInt(long offsetBytes,
int expect,
int update)
Atomically sets the current value at the memory location to the given updated value
if and only if the current value
== the expected value. |
boolean |
compareAndSwapLong(long offsetBytes,
long expect,
long update)
Atomically sets the current value at the memory location to the given updated value
if and only if the current value
== the expected value. |
void |
copy(long srcOffsetBytes,
long dstOffsetBytes,
long lengthBytes)
Copies bytes from a source region of this Memory to a destination region of this Memory.
|
void |
fill(byte value)
Fills all bytes of this Memory region to the given byte value.
|
void |
fill(long offsetBytes,
long lengthBytes,
byte value)
Fills a portion of this Memory region to the given byte value.
|
int |
getAndSetInt(long offsetBytes,
int newValue)
Atomically exchanges the given value with the current value located at offsetBytes.
|
long |
getAndSetLong(long offsetBytes,
long newValue)
Atomically exchanges the given value with the current value located at offsetBytes.
|
NativeMemory |
getNativeMemory()
Returns the root NativeMemory, which could also be the derived MemoryMappedFile or AllocMemory.
|
Object |
getParent()
Gets the parent Memory or backing array.
|
boolean |
isReadOnly()
Returns true if this Memory is read only
|
void |
putBoolean(long offsetBytes,
boolean srcValue)
Puts the boolean value at the given offset
|
void |
putBooleanArray(long offsetBytes,
boolean[] srcArray,
int srcOffset,
int length)
Puts the boolean array at the given offset
|
void |
putByte(long offsetBytes,
byte srcValue)
Puts the byte value at the given offset
|
void |
putByteArray(long offsetBytes,
byte[] srcArray,
int srcOffset,
int length)
Puts the byte array at the given offset
|
void |
putChar(long offsetBytes,
char srcValue)
Puts the char value at the given offset
|
void |
putCharArray(long offsetBytes,
char[] srcArray,
int srcOffset,
int length)
Puts the char array at the given offset
|
void |
putDouble(long offsetBytes,
double srcValue)
Puts the double value at the given offset
|
void |
putDoubleArray(long offsetBytes,
double[] srcArray,
int srcOffset,
int length)
Puts the double array at the given offset
|
void |
putFloat(long offsetBytes,
float srcValue)
Puts the float value at the given offset
|
void |
putFloatArray(long offsetBytes,
float[] srcArray,
int srcOffset,
int length)
Puts the float array at the given offset
|
void |
putInt(long offsetBytes,
int srcValue)
Puts the int value at the given offset
|
void |
putIntArray(long offsetBytes,
int[] srcArray,
int srcOffset,
int length)
Puts the int array at the given offset
|
void |
putLong(long offsetBytes,
long srcValue)
Puts the long value at the given offset
|
void |
putLongArray(long offsetBytes,
long[] srcArray,
int srcOffset,
int length)
Puts the long array at the given offset
|
void |
putShort(long offsetBytes,
short srcValue)
Puts the short value at the given offset
|
void |
putShortArray(long offsetBytes,
short[] srcArray,
int srcOffset,
int length)
Puts the short array at the given offset
|
void |
setBits(long offsetBytes,
byte bitMask)
Sets the bits defined by the bitMask
|
void |
setMemoryRequest(MemoryRequest memReq)
Sets a MemoryRequest
|
asReadOnlyMemory, getAddress, getBoolean, getBooleanArray, getByte, getByteArray, getCapacity, getChar, getCharArray, getCumulativeOffset, getDouble, getDoubleArray, getFloat, getFloatArray, getInt, getIntArray, getLong, getLongArray, getMemoryRequest, getShort, getShortArray, hasArray, hasByteBuffer, isAllBitsClear, isAllBitsSet, isAllocated, isAnyBitsClear, isAnyBitsSet, isDirect, reassign, toHexStringpublic MemoryRegionR(Memory memory, long memOffsetBytes, long capacityBytes, MemoryRequest memReq)
public void clear()
Memoryclear in interface Memoryclear in class MemoryRegionpublic void clear(long offsetBytes,
long lengthBytes)
Memoryclear in interface Memoryclear in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startlengthBytes - the length in bytespublic void clearBits(long offsetBytes,
byte bitMask)
MemoryclearBits in interface MemoryclearBits in class MemoryRegionoffsetBytes - offset bytes relative to this Memory start.bitMask - the bits set to one will be clearedpublic void copy(long srcOffsetBytes,
long dstOffsetBytes,
long lengthBytes)
Memorycopy in interface Memorycopy in class MemoryRegionsrcOffsetBytes - the source offsetdstOffsetBytes - the destintaion offsetlengthBytes - the number of bytes to copypublic void fill(long offsetBytes,
long lengthBytes,
byte value)
Memoryfill in interface Memoryfill in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startlengthBytes - the length in bytesvalue - the given byte valuepublic void fill(byte value)
Memoryfill in interface Memoryfill in class MemoryRegionvalue - the given byte valuepublic void putBoolean(long offsetBytes,
boolean srcValue)
MemoryputBoolean in interface MemoryputBoolean in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcValue - the value to putpublic void putBooleanArray(long offsetBytes,
boolean[] srcArray,
int srcOffset,
int length)
MemoryputBooleanArray in interface MemoryputBooleanArray in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcArray - The source array.srcOffset - offset in array unitslength - number of array units to transfer
The size of this array determines the bytes transferred.public void putByte(long offsetBytes,
byte srcValue)
MemoryputByte in interface MemoryputByte in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcValue - the value to putpublic void putByteArray(long offsetBytes,
byte[] srcArray,
int srcOffset,
int length)
MemoryputByteArray in interface MemoryputByteArray in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcArray - The source array.srcOffset - offset in array unitslength - number of array units to transfer
The size of this array determines the bytes transferred.public void putChar(long offsetBytes,
char srcValue)
MemoryputChar in interface MemoryputChar in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcValue - the value to putpublic void putCharArray(long offsetBytes,
char[] srcArray,
int srcOffset,
int length)
MemoryputCharArray in interface MemoryputCharArray in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcArray - The source array.srcOffset - offset in array unitslength - number of array units to transfer
The size of this array determines the bytes transferred.public void putDouble(long offsetBytes,
double srcValue)
MemoryputDouble in interface MemoryputDouble in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcValue - the value to putpublic void putDoubleArray(long offsetBytes,
double[] srcArray,
int srcOffset,
int length)
MemoryputDoubleArray in interface MemoryputDoubleArray in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcArray - The source array.srcOffset - offset in array unitslength - number of array units to transfer
The size of this array determines the bytes transferred.public void putFloat(long offsetBytes,
float srcValue)
MemoryputFloat in interface MemoryputFloat in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcValue - the value to putpublic void putFloatArray(long offsetBytes,
float[] srcArray,
int srcOffset,
int length)
MemoryputFloatArray in interface MemoryputFloatArray in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcArray - The source array.srcOffset - offset in array unitslength - number of array units to transfer
The size of this array determines the bytes transferred.public void putInt(long offsetBytes,
int srcValue)
MemoryputInt in interface MemoryputInt in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcValue - the value to putpublic void putIntArray(long offsetBytes,
int[] srcArray,
int srcOffset,
int length)
MemoryputIntArray in interface MemoryputIntArray in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcArray - The source array.srcOffset - offset in array unitslength - number of array units to transfer
The size of this array determines the bytes transferred.public void putLong(long offsetBytes,
long srcValue)
MemoryputLong in interface MemoryputLong in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcValue - the value to putpublic void putLongArray(long offsetBytes,
long[] srcArray,
int srcOffset,
int length)
MemoryputLongArray in interface MemoryputLongArray in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcArray - The source array.srcOffset - offset in array unitslength - number of array units to transfer
The size of this array determines the bytes transferred.public void putShort(long offsetBytes,
short srcValue)
MemoryputShort in interface MemoryputShort in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcValue - the value to putpublic void putShortArray(long offsetBytes,
short[] srcArray,
int srcOffset,
int length)
MemoryputShortArray in interface MemoryputShortArray in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startsrcArray - The source array.srcOffset - offset in array unitslength - number of array units to transfer
The size of this array determines the bytes transferred.public void setBits(long offsetBytes,
byte bitMask)
MemorysetBits in interface MemorysetBits in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startbitMask - the bits set to one will be setpublic int addAndGetInt(long offsetBytes,
int delta)
MemoryaddAndGetInt in interface MemoryaddAndGetInt in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startdelta - the amount to addpublic long addAndGetLong(long offsetBytes,
long delta)
MemoryaddAndGetLong in interface MemoryaddAndGetLong in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startdelta - the amount to addpublic boolean compareAndSwapInt(long offsetBytes,
int expect,
int update)
Memory== the expected value.compareAndSwapInt in interface MemorycompareAndSwapInt in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startexpect - the expected valueupdate - the new valuetrue if successful. False return indicates that
the current value at the memory location was not equal to the expected value.public boolean compareAndSwapLong(long offsetBytes,
long expect,
long update)
Memory== the expected value.compareAndSwapLong in interface MemorycompareAndSwapLong in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startexpect - the expected valueupdate - the new valuetrue if successful. False return indicates that
the current value at the memory location was not equal to the expected value.public int getAndSetInt(long offsetBytes,
int newValue)
MemorygetAndSetInt in interface MemorygetAndSetInt in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startnewValue - new valuepublic long getAndSetLong(long offsetBytes,
long newValue)
MemorygetAndSetLong in interface MemorygetAndSetLong in class MemoryRegionoffsetBytes - offset bytes relative to this Memory startnewValue - new valuepublic Object array()
Memoryarray in interface Memoryarray in class MemoryRegionpublic ByteBuffer byteBuffer()
MemorybyteBuffer in interface MemorybyteBuffer in class MemoryRegionpublic NativeMemory getNativeMemory()
MemorygetNativeMemory in interface MemorygetNativeMemory in class MemoryRegionpublic Object getParent()
MemorygetParent in interface MemorygetParent in class MemoryRegionpublic boolean isReadOnly()
MemoryisReadOnly in interface MemoryisReadOnly in class MemoryRegionpublic void setMemoryRequest(MemoryRequest memReq)
MemorysetMemoryRequest in interface MemorysetMemoryRequest in class MemoryRegionmemReq - the MemoryRequestCopyright © 2015–2017 Yahoo! Inc.. All rights reserved.