2010-11-09 Francois Chouinard <fchouinard@gmail.com> Contribution for Bug315307
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.jni / src / org / eclipse / linuxtools / lttng / jni / common / Jni_C_Constant.java
1 package org.eclipse.linuxtools.lttng.jni.common;
2 /*******************************************************************************
3 * Copyright (c) 2009 Ericsson
4 *
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
9 *
10 * Contributors:
11 * William Bourque (wbourque@gmail.com) - Initial API and implementation
12 *******************************************************************************/
13
14 /**
15 * <b><u>Jni_C_Common</u></b>
16 * <p>
17 * Common constants and methods that should be shared between JNI objects.<p>
18 *
19 * This class is abstract and is intended to be extended by LTTng modules that need the constants.
20 */
21 public abstract class Jni_C_Constant {
22
23 // Needed for native types
24 public static final int NULL = 0;
25
26 // C errno correspondance. Used to interpret LTT return value
27 public static final int EOK = 0;
28 public static final int EPERM = 1;
29 public static final int ERANGE = 34;
30
31 // Timestamps are in nanoseconds, this const ease up the math
32 public static final long NANO = 1000000000;
33
34 /**
35 * Default constructor
36 */
37 public Jni_C_Constant() {
38 }
39
40 /**
41 * "Alternate" .toString()<p>
42 *
43 * Simulates the way Java Object implements "toString()"
44 *
45 * @return The Java hashed UID of the object (i.e. : NAME@HASH)
46 */
47 @SuppressWarnings("nls")
48 public String getReferenceToString() {
49 return this.getClass().getName() + "@" + Integer.toHexString(this.hashCode());
50 }
51 }
This page took 0.030134 seconds and 5 git commands to generate.