1 23 24 package org.objectweb.jorm.runtime.gcindex; 25 26 import org.objectweb.jorm.api.PAccessor; 27 import org.objectweb.jorm.api.PException; 28 import org.objectweb.jorm.naming.api.PName; 29 import org.objectweb.jorm.pobject.gcindex.ByteIndexColAccessor; 30 import org.objectweb.jorm.pobject.gcindex.DateIndexColAccessor; 31 import org.objectweb.jorm.pobject.gcindex.OlongIndexColAccessor; 32 import org.objectweb.jorm.pobject.gcindex.OintIndexColAccessor; 33 import org.objectweb.jorm.pobject.gcindex.OshortIndexColAccessor; 34 import org.objectweb.jorm.pobject.gcindex.OcharIndexColAccessor; 35 import org.objectweb.jorm.pobject.gcindex.ObyteIndexColAccessor; 36 import org.objectweb.jorm.pobject.gcindex.LongIndexColAccessor; 37 import org.objectweb.jorm.pobject.gcindex.IntIndexColAccessor; 38 import org.objectweb.jorm.pobject.gcindex.ShortIndexColAccessor; 39 import org.objectweb.jorm.pobject.gcindex.CharIndexColAccessor; 40 import org.objectweb.jorm.pobject.gcindex.StringIndexColAccessor; 41 import junit.framework.Assert; 42 43 46 public class GcRefAccessor implements 47 ByteIndexColAccessor, 48 CharIndexColAccessor, 49 ShortIndexColAccessor, 50 IntIndexColAccessor, 51 LongIndexColAccessor, 52 ObyteIndexColAccessor, 53 OcharIndexColAccessor, 54 OshortIndexColAccessor, 55 OintIndexColAccessor, 56 OlongIndexColAccessor, 57 DateIndexColAccessor, 58 StringIndexColAccessor, 59 PAccessor { 60 private PName gcRef; 61 62 public GcRefAccessor(PName gcRef) { 63 this.gcRef = gcRef; 64 } 65 66 public boolean equals(Object obj) { 67 Assert.assertTrue("Wrong object class: should be a GcRefAccessor", obj instanceof GcRefAccessor); 68 Assert.assertEquals("Wrong refernce", gcRef, ((GcRefAccessor) obj).gcRef); 69 return true; 70 } 71 72 public Object getMemoryInstance() { 73 return this; 74 } 75 76 public void paSetMygc(PName val, Object connection) throws PException { 78 gcRef = val; 79 } 80 81 public PName paGetMygc(Object connection) throws PException { 82 return gcRef; 83 } 84 } 85 | Popular Tags |