summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/id.java
blob: 2a77e7807d8f73770863714aa4b6ef14c188fdf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*******************************************************************************
 * Copyright (c) 2007, 2011 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.swt.internal.cocoa;

/**
 * @jniclass flags=no_gen
 */
public class id {

public long /*int*/ id;

public id() {
}

public id(long /*int*/ id) {
	this.id = id;
}

public id(id id) {
	this.id = id != null ? id.id : 0;
}

public int hashCode() {
	return (int) this.id;
}

public boolean equals(Object other) {
	return (this.id == ((id)other).id);
}

public long /*int*/ objc_getClass() {
	String name = getClass().getName();
	int index = name.lastIndexOf('.');
	if (index != -1) name = name.substring(index + 1);
	return OS.objc_getClass(name);
}

public String toString() {
	return getClass().getName() + "{" + id +  "}";
}
}