Top Fields Constructors Methods
jnr.ffi.provider.jffi

pack-priv Class AllocatedDirectMemoryIO

extends DirectMemoryIO
Class Inheritance
Imports
jnr.ffi.Runtime, java.util.concurrent.atomic.AtomicBoolean

Field Summary

Modifier and TypeField and Description
private final AtomicBoolean
private final long
Inherited from jnr.ffi.provider.jffi.DirectMemoryIO:
IO

Constructor Summary

AccessConstructor and Description
public
AllocatedDirectMemoryIO(Runtime runtime, long size, boolean clear)

Method Summary

Modifier and TypeMethod and Description
public final void
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides jnr.ffi.provider.jffi.DirectMemoryIO.equals.

Indicates whether some other object is "equal to" this one.
protected void
finalize()

Overrides java.lang.Object.finalize.

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
public int
hashCode()

Overrides jnr.ffi.provider.jffi.DirectMemoryIO.hashCode.

Returns a hash code value for this object.
public long
size()

Overrides jnr.ffi.provider.jffi.DirectMemoryIO.size.

Gets the size of this memory object in bytes (optional operation).
Inherited from jnr.ffi.provider.jffi.DirectMemoryIO:
arrayarrayLengtharrayOffsetgetgetgetgetgetgetgetBytegetDoublegetFloatgetIntgetLongLonggetPointergetPointergetShortgetStringgetStringhasArrayindexOfputputputputputputputByteputDoubleputFloatputIntputLongLongputPointerputShortputStringputZeroTerminatedByteArraysetMemorytransferFromtransferTo

Field Detail

allocatedback to summary
private final AtomicBoolean allocated
sizeback to summary
private final long size

Constructor Detail

AllocatedDirectMemoryIOback to summary
public AllocatedDirectMemoryIO(Runtime runtime, long size, boolean clear)

Method Detail

disposeback to summary
public final void dispose()
equalsback to summary
public boolean equals(Object obj)

Overrides jnr.ffi.provider.jffi.DirectMemoryIO.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
finalizeback to summary
protected void finalize() throws Throwable

Overrides java.lang.Object.finalize.

Doc from java.lang.Object.finalize.

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. A subclass overrides the finalize method to dispose of system resources or to perform other cleanup.

When running in a Java virtual machine in which finalization has been disabled or removed, the garbage collector will never call finalize(). In a Java virtual machine in which finalization is enabled, the garbage collector might call finalize only after an indefinite delay.

The general contract of finalize is that it is invoked if and when the Java virtual machine has determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, except as a result of an action taken by the finalization of some other object or class which is ready to be finalized. The finalize method may take any action, including making this object available again to other threads; the usual purpose of finalize, however, is to perform cleanup actions before the object is irrevocably discarded. For example, the finalize method for an object that represents an input/output connection might perform explicit I/O transactions to break the connection before the object is permanently discarded.

The finalize method of class Object performs no special action; it simply returns normally. Subclasses of Object may override this definition.

The Java programming language does not guarantee which thread will invoke the finalize method for any given object. It is guaranteed, however, that the thread that invokes finalize will not be holding any user-visible synchronization locks when finalize is invoked. If an uncaught exception is thrown by the finalize method, the exception is ignored and finalization of that object terminates.

After the finalize method has been invoked for an object, no further action is taken until the Java virtual machine has again determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, including possible actions by other objects or classes which are ready to be finalized, at which point the object may be discarded.

The finalize method is never invoked more than once by a Java virtual machine for any given object.

Any exception thrown by the finalize method causes the finalization of this object to be halted, but is otherwise ignored.

Annotations
@Override
Exceptions
Throwable:
the Exception raised by this method
hashCodeback to summary
public int hashCode()

Overrides jnr.ffi.provider.jffi.DirectMemoryIO.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
sizeback to summary
public long size()

Overrides jnr.ffi.provider.jffi.DirectMemoryIO.size.

Doc from jnr.ffi.Pointer.size.

Gets the size of this memory object in bytes (optional operation).

Returns:long

the size of the memory area this Pointer points to. If the size is unknown, java.lang.Long#MAX_VALUE is returned}.

Annotations
@Override