1 24 25 package com.mckoi.database; 26 27 38 39 public final class TableAccessState { 40 41 44 private Table table; 45 46 49 private boolean been_locked; 50 51 54 TableAccessState(Table table) { 55 this.table = table; 56 been_locked = false; 57 } 58 59 65 public TObject getCellContents(int column, int row) { 66 return table.getCellContents(column, row); 67 } 68 69 73 public DataTableDef getDataTableDef() { 74 return table.getDataTableDef(); 75 } 76 77 82 public Variable getResolvedVariable(int column) { 83 return table.getResolvedVariable(column); 84 } 85 86 94 101 107 public void lockRoot(int key) { 108 if (!been_locked) { 109 table.lockRoot(key); 110 been_locked = true; 111 } 112 } 113 114 117 public void unlockRoot(int key) { 118 if (been_locked) { table.unlockRoot(key); 120 been_locked = false; 121 } 122 else { 123 throw new RuntimeException ("The root rows aren't locked."); 124 } 125 } 126 127 } 128 | Popular Tags |