public BoundingBox extractObject(SQLiteStatement stmt) throws SQLiteException, StreamCorruptedException { int bbId = stmt.columnInt(0); byte[] bbBytes = stmt.columnBlob(1); int runSliceId = stmt.columnInt(2); int firstSpectrumId = stmt.columnInt(3); int lastSpectrumId = stmt.columnInt(4); BoundingBox bb = BoundingBoxBuilder.buildBB( bbId, bbBytes, firstSpectrumId, lastSpectrumId, this.spectrumHeaderById, this.dataEncodingBySpectrumId ); bb.setRunSliceId(runSliceId); return bb; }
public BoundingBox extractObject(SQLiteStatement stmt) throws SQLiteException, StreamCorruptedException { int bbId = stmt.columnInt(0); byte[] bbBytes = stmt.columnBlob(1); int runSliceId = stmt.columnInt(2); int firstSpectrumId = stmt.columnInt(3); int lastSpectrumId = stmt.columnInt(4); BoundingBox bb = BoundingBoxBuilder.buildBB( bbId, bbBytes, firstSpectrumId, lastSpectrumId, this.spectrumHeaderById, this.dataEncodingBySpectrumId ); bb.setRunSliceId(runSliceId); return bb; }
public int columnInt(String columnName) throws SQLiteException { return this.stmt.columnInt(sqliteQuery.getColumnIndex(columnName)); }
public int columnInt(String columnName) throws SQLiteException { return this.stmt.columnInt(sqliteQuery.getColumnIndex(columnName)); }
public int extractSingleInt() throws SQLiteException { this.stmt.step(); int result = this.stmt.columnInt(0); this.dispose(); return result; }
public int extractSingleInt() throws SQLiteException { this.stmt.step(); int result = this.stmt.columnInt(0); this.dispose(); return result; }
/** * Gets the mz range. * * @param msLevel * the ms level * @return runSlice min mz and runSlice max mz * @throws SQLiteException * the sQ lite exception */ public static int[] getMzRange(int msLevel, SQLiteConnection connection) throws SQLiteException { final SQLiteStatement stmt = connection.prepare("SELECT min(begin_mz), max(end_mz) FROM run_slice WHERE ms_level=?"); stmt.bind(1, msLevel); stmt.step(); final int minMz = stmt.columnInt(0); final int maxMz = stmt.columnInt(1); stmt.dispose(); final int[] mzRange = { minMz, maxMz }; return mzRange; }
/** * Gets the mz range. * * @param msLevel * the ms level * @return runSlice min mz and runSlice max mz * @throws SQLiteException * the sQ lite exception */ public static int[] getMzRange(int msLevel, SQLiteConnection connection) throws SQLiteException { final SQLiteStatement stmt = connection.prepare("SELECT min(begin_mz), max(end_mz) FROM run_slice WHERE ms_level=?"); stmt.bind(1, msLevel); stmt.step(); final int minMz = stmt.columnInt(0); final int maxMz = stmt.columnInt(1); stmt.dispose(); final int[] mzRange = { minMz, maxMz }; return mzRange; }
/** * Utility method to run the query on the db and return the value in the * first column of the first row. */ public static int intForQuery(SQLiteConnection conn, String query, Object[] bindArgs) throws SQLiteException { SQLiteStatement stmt = null; try { stmt = bindArguments(conn.prepare(query), bindArgs); if (stmt.step()) { return stmt.columnInt(0); } else { throw new IllegalStateException("query failed to return any result: " + query); } } finally { SQLiteWrapperUtils.disposeQuietly(stmt); } }
if (st.hasRow()) { dos.writeUTF(st.columnString(0)); dos.writeInt(st.columnInt(1)); dos.writeDouble(st.columnDouble(2)); dos.writeUTF(st.columnString(3));
int msLevel = stmt.columnInt(SpectrumHeaderColIdx.msLevel); if (msLevel >= 2) { precursorMz = stmt.columnDouble(SpectrumHeaderColIdx.mainPrecursorMz); precursorCharge = stmt.columnInt(SpectrumHeaderColIdx.mainPrecursorCharge); int bbFirstSpectrumId = stmt.columnInt(SpectrumHeaderColIdx.bbFirstSpectrumId); DataEncoding dataEnc = _dataEncodingReader.getDataEncoding(stmt.columnInt(SpectrumHeaderColIdx.dataEncodingId), connection); stmt.columnInt(SpectrumHeaderColIdx.initialId), stmt.columnInt(SpectrumHeaderColIdx.cycleCol), (float) stmt.columnDouble(SpectrumHeaderColIdx.time), msLevel, stmt.columnInt(SpectrumHeaderColIdx.dataPointsCount), isHighRes, (float) stmt.columnDouble(SpectrumHeaderColIdx.tic),
int msLevel = stmt.columnInt(SpectrumHeaderColIdx.msLevel); if (msLevel >= 2) { precursorMz = stmt.columnDouble(SpectrumHeaderColIdx.mainPrecursorMz); precursorCharge = stmt.columnInt(SpectrumHeaderColIdx.mainPrecursorCharge); int bbFirstSpectrumId = stmt.columnInt(SpectrumHeaderColIdx.bbFirstSpectrumId); DataEncoding dataEnc = _dataEncodingReader.getDataEncoding(stmt.columnInt(SpectrumHeaderColIdx.dataEncodingId), connection); stmt.columnInt(SpectrumHeaderColIdx.initialId), stmt.columnInt(SpectrumHeaderColIdx.cycleCol), (float) stmt.columnDouble(SpectrumHeaderColIdx.time), msLevel, stmt.columnInt(SpectrumHeaderColIdx.dataPointsCount), isHighRes, (float) stmt.columnDouble(SpectrumHeaderColIdx.tic),