abstractmemoryblock.java
来自「jnative java 调用动态库需要的包和dll」· Java 代码 · 共 50 行
JAVA
50 行
package org.xvolks.jnative.pointers.memory;
/**
* $Id: AbstractMemoryBlock.java,v 1.3 2006/06/09 20:44:04 mdenty Exp $
*
* <p>New Memory blocks should extends this class</p>
*
* This software is released under the LGPL.
* @author Created by Marc DENTY - (c) 2006 JNative project
*/
public abstract class AbstractMemoryBlock implements MemoryBlock {
private Integer pointer;
private int size;
AbstractMemoryBlock(int size) {
this.size = size;
}
/**
* Method getSize
* @return the size of this memory block
* @exception NullPointerException if the pointer is null
*/
public final int getSize() throws NullPointerException {
return size;
}
/**
* Method getPointer
* @return the pointer that addresses the memory block
*/
public final Integer getPointer() throws NullPointerException {
return pointer;
}
protected void setPointer(Integer pointer) {
if(pointer == null)
size = 0;
this.pointer = pointer;
}
protected void setSize(int size) {
this.size = size;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?