Android Open Source - sqlite-analyzer Table






From Project

Back to project page sqlite-analyzer.

License

The source code is released under:

Apache License

If you think the Android project sqlite-analyzer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.novoda.sqlite.model;
// w ww . ja v  a 2s .  co  m
import com.novoda.sqlite.StringUtil;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public final class Table {
    private final String name;
    private final List<Column> columns = new ArrayList<Column>();
    private final String sql;
    private final boolean isView;
    private final List<Table> dependents = new ArrayList<Table>();

    public Table(String name, String sql, boolean isView) {
        this.name = name;
        this.sql = sql;
        this.isView = isView;
    }

    public boolean isView() {
        return isView;
    }

    public void addColumn(Column column) {
        columns.add(column);
    }

    public Column findColumnByName(String name) {
        for (Column column : columns) {
            if (column.getName().equalsIgnoreCase(name))
                return column;
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public String getCamelizedName() {
        return StringUtil.camelify(name);
    }

    public String getSql() {
        return sql;
    }

    public Collection<Column> getColumns() {
        return Collections.unmodifiableCollection(columns);
    }

    public void addDependent(Table table) {
        dependents.add(table);
    }

    public Collection<Table> getDependents() {
        return Collections.unmodifiableCollection(dependents);
    }

    @Override
    public String toString() {
        return "Table{" +
                "name='" + name + '\'' +
                '}';
    }
}




Java Source Code List

com.example.MainActivity.java
com.example.MainActivity.java
com.example.MyDatabase.java
com.example.MyDatabase.java
com.novoda.sqlite.Analyzer.java
com.novoda.sqlite.Connector.java
com.novoda.sqlite.FileConnector.java
com.novoda.sqlite.MigrationsConnector.java
com.novoda.sqlite.MigrationsInDir.java
com.novoda.sqlite.Migrations.java
com.novoda.sqlite.NumberedFilesComparator.java
com.novoda.sqlite.StringUtilOld.java
com.novoda.sqlite.StringUtil.java
com.novoda.sqlite.impl.SQLFile.java
com.novoda.sqlite.impl.TableCreateStatementParser.java
com.novoda.sqlite.model.Column.java
com.novoda.sqlite.model.DataAffinity.java
com.novoda.sqlite.model.Database.java
com.novoda.sqlite.model.Table.java
com.novoda.sqliteprovider.demo.simple.provider.FireworkProvider.java
com.novoda.sqliteprovider.demo.simple.ui.MainActivity.java
com.novoda.sqliteprovider.demo.simple.ui.MainFragment.java