Java tutorial
// Description: Java6 in-memory RAM DbIO implementation for ClearTopDep. /* * MSS Code Factory 1.11 * * Copyright (c) 2012-2014 Mark Sobkow * * This program is available as free software under the GNU GPL v3, or * under a commercial license from Mark Sobkow. For commercial licensing * details, please contact msobkow@sasktel.net. * * Under the terms of the GPL: * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * *********************************************************************** * * $Revision$ */ package net.sourceforge.msscodefactory.v1_11.MSSBamRam; import java.sql.*; import java.util.*; import net.sourceforge.msscodefactory.cflib.v1_11.CFLib.*; import org.apache.commons.codec.binary.Base64; import net.sourceforge.msscodefactory.v1_11.MSSBam.*; import net.sourceforge.msscodefactory.v1_11.MSSBamBL.*; import net.sourceforge.msscodefactory.v1_11.MSSBamBLRam.*; /* * MSSBamRamClearTopDepTable in-memory RAM DbIO implementation * for ClearTopDep. */ public class MSSBamRamClearTopDepTable implements IMSSBamClearTopDepTable { private MSSBamBLRamSchema schema; private Map<MSSBamAnyObjPKey, MSSBamClearTopDepBuff> dictByPKey = new HashMap<MSSBamAnyObjPKey, MSSBamClearTopDepBuff>(); private SortedMap<MSSBamClearTopDepByContTblIdxKey, SortedMap<MSSBamAnyObjPKey, MSSBamClearTopDepBuff>> dictByContTblIdx = new TreeMap<MSSBamClearTopDepByContTblIdxKey, SortedMap<MSSBamAnyObjPKey, MSSBamClearTopDepBuff>>(); public MSSBamRamClearTopDepTable(MSSBamBLRamSchema argSchema) { schema = argSchema; } public void createClearTopDep(MSSBamAuthorization Authorization, MSSBamClearTopDepBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setClassCode(Buff.getClassCode()); pkey.setRequiredId(Buff.getRequiredId()); MSSBamClearTopDepByContTblIdxKey keyContTblIdx = schema.getFactoryClearTopDep().newContTblIdxKey(); keyContTblIdx.setRequiredContTableId(Buff.getRequiredContTableId()); // Validate unique indexes if (dictByPKey.containsKey(pkey)) { throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(), "createClearTopDep", pkey); } // Validate foreign keys { boolean allNull = true; allNull = false; if (!allNull) { if (null == schema.getTableClearDep().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "createClearTopDep", "Superclass", "SuperClass", "ClearDep", null); } } } { boolean allNull = true; allNull = false; if (!allNull) { if (null == schema.getTableTable().readDerivedByIdIdx(Authorization, Buff.getRequiredContTableId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "createClearTopDep", "Container", "ContTable", "Table", null); } } } // Proceed with adding the new record dictByPKey.put(pkey, Buff); SortedMap<MSSBamAnyObjPKey, MSSBamClearTopDepBuff> subdictContTblIdx; if (dictByContTblIdx.containsKey(keyContTblIdx)) { subdictContTblIdx = dictByContTblIdx.get(keyContTblIdx); } else { subdictContTblIdx = new TreeMap<MSSBamAnyObjPKey, MSSBamClearTopDepBuff>(); dictByContTblIdx.put(keyContTblIdx, subdictContTblIdx); } subdictContTblIdx.put(pkey, Buff); } public MSSBamClearTopDepBuff readDerived(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamClearTopDep.readDerived() "; MSSBamAnyObjPKey key = schema.getFactoryAnyObj().newPKey(); key.setRequiredId(PKey.getRequiredId()); MSSBamClearTopDepBuff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public MSSBamClearTopDepBuff lockDerived(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamClearTopDep.readDerived() "; MSSBamAnyObjPKey key = schema.getFactoryAnyObj().newPKey(); key.setRequiredId(PKey.getRequiredId()); MSSBamClearTopDepBuff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public MSSBamClearTopDepBuff[] readAllDerived(MSSBamAuthorization Authorization) { final String S_ProcName = "MSSBamRamClearTopDep.readAllDerived() "; MSSBamClearTopDepBuff[] retList = new MSSBamClearTopDepBuff[dictByPKey.values().size()]; Iterator<MSSBamClearTopDepBuff> iter = dictByPKey.values().iterator(); int idx = 0; while (iter.hasNext()) { retList[idx++] = iter.next(); } return (retList); } public MSSBamClearTopDepBuff[] readDerivedByTenantIdx(MSSBamAuthorization Authorization, long TenantId) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByTenantIdx() "; MSSBamAnyObjBuff buffList[] = schema.getTableAnyObj().readDerivedByTenantIdx(Authorization, TenantId); if (buffList == null) { return (null); } else { MSSBamAnyObjBuff buff; ArrayList<MSSBamClearTopDepBuff> filteredList = new ArrayList<MSSBamClearTopDepBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamClearTopDepBuff)) { filteredList.add((MSSBamClearTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamClearTopDepBuff[0])); } } public MSSBamClearTopDepBuff[] readDerivedByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByScopeIdx() "; MSSBamAnyObjBuff buffList[] = schema.getTableAnyObj().readDerivedByScopeIdx(Authorization, ScopeId); if (buffList == null) { return (null); } else { MSSBamAnyObjBuff buff; ArrayList<MSSBamClearTopDepBuff> filteredList = new ArrayList<MSSBamClearTopDepBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamClearTopDepBuff)) { filteredList.add((MSSBamClearTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamClearTopDepBuff[0])); } } public MSSBamClearTopDepBuff[] readDerivedByDefSchemaIdx(MSSBamAuthorization Authorization, Long DefSchemaId) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByDefSchemaIdx() "; MSSBamAnyObjBuff buffList[] = schema.getTableAnyObj().readDerivedByDefSchemaIdx(Authorization, DefSchemaId); if (buffList == null) { return (null); } else { MSSBamAnyObjBuff buff; ArrayList<MSSBamClearTopDepBuff> filteredList = new ArrayList<MSSBamClearTopDepBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamClearTopDepBuff)) { filteredList.add((MSSBamClearTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamClearTopDepBuff[0])); } } public MSSBamClearTopDepBuff[] readDerivedByAuthorIdx(MSSBamAuthorization Authorization, Long AuthorId) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByAuthorIdx() "; MSSBamAnyObjBuff buffList[] = schema.getTableAnyObj().readDerivedByAuthorIdx(Authorization, AuthorId); if (buffList == null) { return (null); } else { MSSBamAnyObjBuff buff; ArrayList<MSSBamClearTopDepBuff> filteredList = new ArrayList<MSSBamClearTopDepBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamClearTopDepBuff)) { filteredList.add((MSSBamClearTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamClearTopDepBuff[0])); } } public MSSBamClearTopDepBuff readDerivedByUNameIdx(MSSBamAuthorization Authorization, Long ScopeId, String Name) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByUNameIdx() "; MSSBamAnyObjBuff buff = schema.getTableAnyObj().readDerivedByUNameIdx(Authorization, ScopeId, Name); if (buff == null) { return (null); } else if (buff instanceof MSSBamClearTopDepBuff) { return ((MSSBamClearTopDepBuff) buff); } else { return (null); } } public MSSBamClearTopDepBuff[] readDerivedByTableIdx(MSSBamAuthorization Authorization, long RelationId) { final String S_ProcName = "MSSBamRamClearDep.readDerivedByTableIdx() "; MSSBamClearDepBuff buffList[] = schema.getTableClearDep().readDerivedByTableIdx(Authorization, RelationId); if (buffList == null) { return (null); } else { MSSBamClearDepBuff buff; ArrayList<MSSBamClearTopDepBuff> filteredList = new ArrayList<MSSBamClearTopDepBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamClearTopDepBuff)) { filteredList.add((MSSBamClearTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamClearTopDepBuff[0])); } } public MSSBamClearTopDepBuff[] readDerivedByContTblIdx(MSSBamAuthorization Authorization, long ContTableId) { final String S_ProcName = "MSSBamRamClearTopDep.readDerivedByContTblIdx() "; MSSBamClearTopDepByContTblIdxKey key = schema.getFactoryClearTopDep().newContTblIdxKey(); key.setRequiredContTableId(ContTableId); MSSBamClearTopDepBuff[] recArray; if (dictByContTblIdx.containsKey(key)) { SortedMap<MSSBamAnyObjPKey, MSSBamClearTopDepBuff> subdictContTblIdx = dictByContTblIdx.get(key); recArray = new MSSBamClearTopDepBuff[subdictContTblIdx.size()]; Iterator<MSSBamClearTopDepBuff> iter = subdictContTblIdx.values().iterator(); int idx = 0; while (iter.hasNext()) { recArray[idx++] = iter.next(); } } else { recArray = new MSSBamClearTopDepBuff[0]; } return (recArray); } public MSSBamClearTopDepBuff readDerivedByIdIdx(MSSBamAuthorization Authorization, long Id) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByIdIdx() "; MSSBamAnyObjPKey key = schema.getFactoryAnyObj().newPKey(); key.setRequiredId(Id); MSSBamClearTopDepBuff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public MSSBamClearTopDepBuff readBuff(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamClearTopDep.readBuff() "; MSSBamClearTopDepBuff buff = readDerived(Authorization, PKey); if ((buff != null) && (!buff.getClassCode().equals("CLRT"))) { buff = null; } return (buff); } public MSSBamClearTopDepBuff lockBuff(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamClearTopDep.readBuff() "; MSSBamClearTopDepBuff buff = readDerived(Authorization, PKey); if ((buff != null) && (!buff.getClassCode().equals("CLRT"))) { buff = null; } return (buff); } public MSSBamClearTopDepBuff[] readAllBuff(MSSBamAuthorization Authorization) { final String S_ProcName = "MSSBamRamClearTopDep.readAllBuff() "; MSSBamClearTopDepBuff buff; ArrayList<MSSBamClearTopDepBuff> filteredList = new ArrayList<MSSBamClearTopDepBuff>(); MSSBamClearTopDepBuff[] buffList = readAllDerived(Authorization); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("CLRT")) { filteredList.add(buff); } } return (filteredList.toArray(new MSSBamClearTopDepBuff[0])); } public MSSBamClearTopDepBuff readBuffByIdIdx(MSSBamAuthorization Authorization, long Id) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByIdIdx() "; MSSBamAnyObjBuff buff = readDerivedByIdIdx(Authorization, Id); if ((buff != null) && buff.getClassCode().equals("ANYO")) { return ((MSSBamClearTopDepBuff) buff); } else { return (null); } } public MSSBamClearTopDepBuff[] readBuffByTenantIdx(MSSBamAuthorization Authorization, long TenantId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByTenantIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamClearTopDepBuff> filteredList = new ArrayList<MSSBamClearTopDepBuff>(); MSSBamAnyObjBuff[] buffList = readDerivedByTenantIdx(Authorization, TenantId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("ANYO")) { filteredList.add((MSSBamClearTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamClearTopDepBuff[0])); } public MSSBamClearTopDepBuff[] readBuffByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByScopeIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamClearTopDepBuff> filteredList = new ArrayList<MSSBamClearTopDepBuff>(); MSSBamAnyObjBuff[] buffList = readDerivedByScopeIdx(Authorization, ScopeId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("ANYO")) { filteredList.add((MSSBamClearTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamClearTopDepBuff[0])); } public MSSBamClearTopDepBuff[] readBuffByDefSchemaIdx(MSSBamAuthorization Authorization, Long DefSchemaId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByDefSchemaIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamClearTopDepBuff> filteredList = new ArrayList<MSSBamClearTopDepBuff>(); MSSBamAnyObjBuff[] buffList = readDerivedByDefSchemaIdx(Authorization, DefSchemaId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("ANYO")) { filteredList.add((MSSBamClearTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamClearTopDepBuff[0])); } public MSSBamClearTopDepBuff[] readBuffByAuthorIdx(MSSBamAuthorization Authorization, Long AuthorId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByAuthorIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamClearTopDepBuff> filteredList = new ArrayList<MSSBamClearTopDepBuff>(); MSSBamAnyObjBuff[] buffList = readDerivedByAuthorIdx(Authorization, AuthorId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("ANYO")) { filteredList.add((MSSBamClearTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamClearTopDepBuff[0])); } public MSSBamClearTopDepBuff readBuffByUNameIdx(MSSBamAuthorization Authorization, Long ScopeId, String Name) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByUNameIdx() "; MSSBamAnyObjBuff buff = readDerivedByUNameIdx(Authorization, ScopeId, Name); if ((buff != null) && buff.getClassCode().equals("ANYO")) { return ((MSSBamClearTopDepBuff) buff); } else { return (null); } } public MSSBamClearTopDepBuff[] readBuffByTableIdx(MSSBamAuthorization Authorization, long RelationId) { final String S_ProcName = "MSSBamRamClearDep.readBuffByTableIdx() "; MSSBamClearDepBuff buff; ArrayList<MSSBamClearTopDepBuff> filteredList = new ArrayList<MSSBamClearTopDepBuff>(); MSSBamClearDepBuff[] buffList = readDerivedByTableIdx(Authorization, RelationId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("CLRD")) { filteredList.add((MSSBamClearTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamClearTopDepBuff[0])); } public MSSBamClearTopDepBuff[] readBuffByContTblIdx(MSSBamAuthorization Authorization, long ContTableId) { final String S_ProcName = "MSSBamRamClearTopDep.readBuffByContTblIdx() "; MSSBamClearTopDepBuff buff; ArrayList<MSSBamClearTopDepBuff> filteredList = new ArrayList<MSSBamClearTopDepBuff>(); MSSBamClearTopDepBuff[] buffList = readDerivedByContTblIdx(Authorization, ContTableId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("CLRT")) { filteredList.add((MSSBamClearTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamClearTopDepBuff[0])); } public void updateClearTopDep(MSSBamAuthorization Authorization, MSSBamClearTopDepBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamClearTopDepBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateClearTopDep", "Existing record not found", "ClearTopDep", pkey); } MSSBamClearTopDepByContTblIdxKey existingKeyContTblIdx = schema.getFactoryClearTopDep().newContTblIdxKey(); existingKeyContTblIdx.setRequiredContTableId(existing.getRequiredContTableId()); MSSBamClearTopDepByContTblIdxKey newKeyContTblIdx = schema.getFactoryClearTopDep().newContTblIdxKey(); newKeyContTblIdx.setRequiredContTableId(Buff.getRequiredContTableId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableClearDep().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateClearTopDep", "Superclass", "SuperClass", "ClearDep", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableTable().readDerivedByIdIdx(Authorization, Buff.getRequiredContTableId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateClearTopDep", "Container", "ContTable", "Table", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamClearTopDepBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByContTblIdx.get(existingKeyContTblIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByContTblIdx.containsKey(newKeyContTblIdx)) { subdict = dictByContTblIdx.get(newKeyContTblIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamClearTopDepBuff>(); dictByContTblIdx.put(newKeyContTblIdx, subdict); } subdict.put(pkey, Buff); } public void deleteClearTopDep(MSSBamAuthorization Authorization, MSSBamClearTopDepBuff Buff) { final String S_ProcName = "MSSBamRamClearTopDepTable.deleteClearTopDep() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamClearTopDepBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteClearTopDep", "Existing record not found", "ClearTopDep", pkey); } if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteClearTopDep", pkey); } MSSBamClearTopDepByContTblIdxKey keyContTblIdx = schema.getFactoryClearTopDep().newContTblIdxKey(); keyContTblIdx.setRequiredContTableId(existing.getRequiredContTableId()); // Validate reverse foreign keys if (schema.getTableClearSubDep1().readDerivedByContClearTopIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteClearTopDep", "Container", "ContClearTopDep", "ClearSubDep1", pkey); } // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamClearTopDepBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContTblIdx.get(keyContTblIdx); subdict.remove(pkey); } public MSSBamCursor openClearTopDepCursorAll(MSSBamAuthorization Authorization) { MSSBamCursor cursor = new MSSBamRamClearTopDepCursor(Authorization, schema, dictByPKey.values()); return (cursor); } public MSSBamCursor openClearTopDepCursorByContTblIdx(MSSBamAuthorization Authorization, long ContTableId) { MSSBamCursor cursor; MSSBamClearTopDepByContTblIdxKey key = schema.getFactoryClearTopDep().newContTblIdxKey(); key.setRequiredContTableId(ContTableId); if (dictByContTblIdx.containsKey(key)) { SortedMap<MSSBamAnyObjPKey, MSSBamClearTopDepBuff> subdictContTblIdx = dictByContTblIdx.get(key); cursor = new MSSBamRamClearTopDepCursor(Authorization, schema, subdictContTblIdx.values()); } else { cursor = new MSSBamRamClearTopDepCursor(Authorization, schema, new ArrayList<MSSBamClearTopDepBuff>()); } return (cursor); } public void closeClearTopDepCursor(MSSBamCursor Cursor) { // Cursor.DataReader.Close(); } public MSSBamClearTopDepBuff nextClearTopDepCursor(MSSBamCursor Cursor) { MSSBamRamClearTopDepCursor cursor = (MSSBamRamClearTopDepCursor) Cursor; MSSBamClearTopDepBuff rec = cursor.getCursor().next(); cursor.setRowIdx(cursor.getRowIdx() + 1); return (rec); } public MSSBamClearTopDepBuff prevClearTopDepCursor(MSSBamCursor Cursor) { int targetRowIdx = (Cursor.getRowIdx() > 1) ? Cursor.getRowIdx() - 1 : 1; MSSBamClearTopDepBuff rec = null; if (Cursor.getRowIdx() >= targetRowIdx) { Cursor.reset(); } while (Cursor.getRowIdx() < targetRowIdx) { rec = nextClearTopDepCursor(Cursor); } return (rec); } public MSSBamClearTopDepBuff firstClearTopDepCursor(MSSBamCursor Cursor) { int targetRowIdx = 1; MSSBamClearTopDepBuff rec = null; Cursor.reset(); while (Cursor.getRowIdx() < targetRowIdx) { rec = nextClearTopDepCursor(Cursor); } return (rec); } public MSSBamClearTopDepBuff lastClearTopDepCursor(MSSBamCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotImplementedYetException(getClass(), "lastClearTopDepCursor"); } public MSSBamClearTopDepBuff nthClearTopDepCursor(MSSBamCursor Cursor, int Idx) { int targetRowIdx = Idx; MSSBamClearTopDepBuff rec = null; if (Cursor.getRowIdx() >= targetRowIdx) { Cursor.reset(); } while (Cursor.getRowIdx() < targetRowIdx) { rec = nextClearTopDepCursor(Cursor); } return (rec); } }