public long insertStation(Station station) { ContentValues contentValue = new ContentValues(); contentValue.put(COLUMN_STATE_NAME, station.getStateName()); contentValue.put(COLUMN_STATION_ID, station.getStationId()); contentValue.put(COLUMN_NAME, station.getName()); return getWritableDatabase().insert(TABLE_STATION, null, contentValue); }
public Station getStation() { if (isBeforeFirst() || isAfterLast()) return null; Station station = new Station(); station.setId(getLong(getColumnIndex(COLUMN_ID))); station.setStateName(getString(getColumnIndex(COLUMN_STATE_NAME))); station.setStationId(getString(getColumnIndex(COLUMN_STATION_ID))); station.setName(getString(getColumnIndex(COLUMN_NAME))); return station; }