All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sql2o.data.Table Maven / Gradle / Ivy

There is a newer version: 0.2.6
Show newest version
package org.sql2o.data;

import java.util.*;

/**
 * Represents an offline result set with columns and rows and data.
 */
public class Table {
    private String name;
    private List rows;
    private List columns;

    public Table(String name, List rows, List columns) {
        this.name = name;
        this.rows = rows;
        this.columns = columns;
    }

    public String getName() {
        return name;
    }

    public List rows() {
        return rows;
    }

    public List columns() {
        return columns;
    }

    public List> asList()
    {
        return new AbstractList>() {
            @Override
            public Map get(int index) {
                return rows.get(index).asMap();
            }

            @Override
            public int size() {
                return rows.size();
            }
        };
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy