BartRunnerAndroid/src/com/dougkeen/bart/data/RoutesColumns.java

29 lines
817 B
Java
Raw Normal View History

2011-05-23 18:59:34 +00:00
package com.dougkeen.bart.data;
public enum RoutesColumns {
2012-01-02 23:08:43 +00:00
_ID("_id", "INTEGER", false),
FROM_STATION("FROM_STATION", "TEXT", false),
TO_STATION("TO_STATION", "TEXT", false),
FARE("FARE", "TEXT", true),
FARE_LAST_UPDATED("FARE_LAST_UPDATED", "INTEGER", true),
AVERAGE_TRIP_SAMPLE_COUNT("AVE_TRIP_SAMPLE_COUNT", "INTEGER", true),
AVERAGE_TRIP_LENGTH("AVE_TRIP_LENGTH", "INTEGER", true);
2011-05-23 18:59:34 +00:00
2012-01-02 23:08:43 +00:00
2011-05-23 18:59:34 +00:00
// This class cannot be instantiated
2012-01-02 23:08:43 +00:00
private RoutesColumns(String string, String type, Boolean nullable) {
2011-05-23 18:59:34 +00:00
this.string = string;
this.sqliteType = type;
2012-01-02 23:08:43 +00:00
this.nullable = nullable;
2011-05-23 18:59:34 +00:00
}
public final String string;
public final String sqliteType;
2012-01-02 23:08:43 +00:00
public final Boolean nullable;
2011-05-23 18:59:34 +00:00
protected String getColumnDef() {
2012-01-02 23:08:43 +00:00
return string + " " + sqliteType + (nullable?"":" NOT NULL");
2011-05-23 18:59:34 +00:00
}
}