Package jnr.ffi.provider.jffi
Class BufferParameterStrategy
- java.lang.Object
-
- com.kenai.jffi.ObjectParameterStrategy
-
- jnr.ffi.provider.jffi.ParameterStrategy
-
- jnr.ffi.provider.jffi.BufferParameterStrategy
-
public final class BufferParameterStrategy extends ParameterStrategy
-
-
Field Summary
Fields Modifier and Type Field Description private static int
BOOLEAN_POSITION_SHIFT
private static int
BYTE_POSITION_SHIFT
private static int
CHAR_POSITION_SHIFT
private static BufferParameterStrategy[]
DIRECT_BUFFER_PARAMETER_STRATEGIES
private static int
DOUBLE_POSITION_SHIFT
private static int
FLOAT_POSITION_SHIFT
private static BufferParameterStrategy[]
HEAP_BUFFER_PARAMETER_STRATEGIES
private static int
INT_POSITION_SHIFT
private static int
LONG_POSITION_SHIFT
private int
shift
private static int
SHORT_POSITION_SHIFT
-
Fields inherited from class jnr.ffi.provider.jffi.ParameterStrategy
objectCount
-
-
Constructor Summary
Constructors Modifier Constructor Description private
BufferParameterStrategy(com.kenai.jffi.ObjectParameterStrategy.StrategyType type, com.kenai.jffi.ObjectParameterType.ComponentType componentType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
address(java.lang.Object o)
static long
address(java.nio.Buffer buffer)
private static long
address(java.nio.Buffer ptr, int shift)
static long
address(java.nio.ByteBuffer ptr)
static long
address(java.nio.CharBuffer ptr)
static long
address(java.nio.DoubleBuffer ptr)
static long
address(java.nio.FloatBuffer ptr)
static long
address(java.nio.IntBuffer ptr)
static long
address(java.nio.LongBuffer ptr)
static long
address(java.nio.ShortBuffer ptr)
(package private) static int
calculateShift(com.kenai.jffi.ObjectParameterType.ComponentType componentType)
(package private) static BufferParameterStrategy
direct(com.kenai.jffi.ObjectParameterType.ComponentType componentType)
(package private) static BufferParameterStrategy
heap(com.kenai.jffi.ObjectParameterType.ComponentType componentType)
int
length(java.lang.Object o)
java.lang.Object
object(java.lang.Object o)
int
offset(java.lang.Object o)
-
-
-
Field Detail
-
BYTE_POSITION_SHIFT
private static final int BYTE_POSITION_SHIFT
- See Also:
- Constant Field Values
-
SHORT_POSITION_SHIFT
private static final int SHORT_POSITION_SHIFT
- See Also:
- Constant Field Values
-
CHAR_POSITION_SHIFT
private static final int CHAR_POSITION_SHIFT
- See Also:
- Constant Field Values
-
BOOLEAN_POSITION_SHIFT
private static final int BOOLEAN_POSITION_SHIFT
- See Also:
- Constant Field Values
-
INT_POSITION_SHIFT
private static final int INT_POSITION_SHIFT
- See Also:
- Constant Field Values
-
FLOAT_POSITION_SHIFT
private static final int FLOAT_POSITION_SHIFT
- See Also:
- Constant Field Values
-
LONG_POSITION_SHIFT
private static final int LONG_POSITION_SHIFT
- See Also:
- Constant Field Values
-
DOUBLE_POSITION_SHIFT
private static final int DOUBLE_POSITION_SHIFT
- See Also:
- Constant Field Values
-
shift
private final int shift
-
DIRECT_BUFFER_PARAMETER_STRATEGIES
private static final BufferParameterStrategy[] DIRECT_BUFFER_PARAMETER_STRATEGIES
-
HEAP_BUFFER_PARAMETER_STRATEGIES
private static final BufferParameterStrategy[] HEAP_BUFFER_PARAMETER_STRATEGIES
-
-
Method Detail
-
address
public static long address(java.nio.ByteBuffer ptr)
-
address
public static long address(java.nio.ShortBuffer ptr)
-
address
public static long address(java.nio.CharBuffer ptr)
-
address
public static long address(java.nio.IntBuffer ptr)
-
address
public static long address(java.nio.FloatBuffer ptr)
-
address
public static long address(java.nio.LongBuffer ptr)
-
address
public static long address(java.nio.DoubleBuffer ptr)
-
address
public static long address(java.nio.Buffer buffer)
-
address
private static long address(java.nio.Buffer ptr, int shift)
-
address
public long address(java.lang.Object o)
- Specified by:
address
in classcom.kenai.jffi.ObjectParameterStrategy
-
object
public java.lang.Object object(java.lang.Object o)
- Specified by:
object
in classcom.kenai.jffi.ObjectParameterStrategy
-
offset
public int offset(java.lang.Object o)
- Specified by:
offset
in classcom.kenai.jffi.ObjectParameterStrategy
-
length
public int length(java.lang.Object o)
- Specified by:
length
in classcom.kenai.jffi.ObjectParameterStrategy
-
calculateShift
static int calculateShift(com.kenai.jffi.ObjectParameterType.ComponentType componentType)
-
direct
static BufferParameterStrategy direct(com.kenai.jffi.ObjectParameterType.ComponentType componentType)
-
heap
static BufferParameterStrategy heap(com.kenai.jffi.ObjectParameterType.ComponentType componentType)
-
-