1 package org
.eclipse
.linuxtools
.internal
.lttng
.jni
.common
;
2 /*******************************************************************************
3 * Copyright (c) 2009 Ericsson
5 * All rights reserved. This program and the accompanying materials are
6 * made available under the terms of the Eclipse Public License v1.0 which
7 * accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
11 * William Bourque (wbourque@gmail.com) - Initial API and implementation
12 *******************************************************************************/
15 * <b><u>Jni_C_Pointer</u></b>
17 * Class pointer to handle properly "C pointer" <p>
19 * Can transparently handle pointer of 32 or 64 bits.
21 public class Jni_C_Pointer
extends Jni_C_Constant
{
23 protected long ptr
= NULL
;
24 protected boolean isLong
= true;
27 * Default constructor.<p>
29 * Note : Pointer will be set to a 64bits "NULL".
31 public Jni_C_Pointer() {
36 * Constructor with parameters for 64bits pointers.
38 * @param newPtr long-converted (64 bits) C pointer.
40 public Jni_C_Pointer(long newPtr
) {
46 * Constructor with parameters for 32bits pointers.
48 * @param newPtr int-converted (32 bits) C pointer.
50 public Jni_C_Pointer(int newPtr
) {
56 * Get the current pointer.
58 * @return The current pointer, in long.
60 public long getPointer() {
65 * Set the pointer, as a 64bits pointer.
67 * @param newPtr long-converted (64 bits) C pointer.
69 public void setPointer(long newPtr
) {
75 * Set the pointer, as a 64bits pointer.
77 * @param newPtr int-converted (32 bits) C pointer.
79 public void setPointer(int newPtr
) {
85 * toString() method. <p>
87 * Convert the pointer to a nice looking int/long hexadecimal format.
89 * @return Attributes of the object concatenated in String
92 @SuppressWarnings("nls")
93 public String
toString() {
94 String returnData
= "0x";
97 returnData
+= Long
.toHexString(ptr
);
100 returnData
+= Integer
.toHexString((int) ptr
);
This page took 0.03767 seconds and 6 git commands to generate.