01: package org.python.core;
02:
03: public abstract class IdImpl {
04:
05: public static IdImpl getInstance() {
06: if (System.getProperty("java.version").compareTo("1.2") >= 0) {
07: try {
08: return (IdImpl) Class
09: .forName("org.python.core.IdImpl2")
10: .newInstance();
11: } catch (Throwable e) {
12: return null;
13: }
14: } else {
15: return new IdImpl1();
16: }
17:
18: }
19:
20: public abstract long id(PyObject o);
21:
22: public abstract String idstr(PyObject o);
23:
24: // o should not be an instance of a subclass of PyObject
25: public abstract long java_obj_id(Object o);
26:
27: }
|