class MetaIndex extends IndexBase {

    private final MetaTable meta;
    private final boolean scan;

    public MetaIndex(MetaTable meta, IndexColumn[] columns, boolean scan) {
        super(meta, 0, null, IndexType.createNonUnique(), columns);
        this.meta = meta;
        this.scan = scan;
    }

    @Override
    public int getColumnIndex(Column col) {<FILL_FUNCTION_BODY>}

    @Override
    public Cursor find(ServerSession session, SearchRow first, SearchRow last) {
        ArrayList<Row> rows = meta.generateRows(session, first, last);
        return new MetaCursor(rows);
    }

    @Override
    public double getCost(ServerSession session, int[] masks, SortOrder sortOrder) {
        if (scan) {
            return 10 * MetaTable.ROW_COUNT_APPROXIMATION;
        }
        return getCostRangeIndex(masks, MetaTable.ROW_COUNT_APPROXIMATION, sortOrder);
    }

    @Override
    public String getCreateSQL() {
        return null;
    }

    @Override
    public long getRowCount(ServerSession session) {
        return MetaTable.ROW_COUNT_APPROXIMATION;
    }

    @Override
    public long getRowCountApproximation() {
        return MetaTable.ROW_COUNT_APPROXIMATION;
    }

    @Override
    public long getDiskSpaceUsed() {
        return meta.getDiskSpaceUsed();
    }

    @Override
    public String getPlanSQL() {
        return "meta";
    }

    /**
     * An index for a meta data table.
     * This index can only scan through all rows, search is not supported.
     */
    private static class MetaCursor implements Cursor {

        private final ArrayList<Row> rows;
        private Row current;
        private int index;

        MetaCursor(ArrayList<Row> rows) {
            this.rows = rows;
        }

        @Override
        public Row get() {
            return current;
        }

        @Override
        public boolean next() {
            current = index >= rows.size() ? null : rows.get(index++);
            return current != null;
        }
    }
}

        if (scan) {
            // the scan index cannot use any columns
            return -1;
        }
        return super.getColumnIndex(col);
    
<methods>public boolean canGetFirstOrLast() ,public boolean canScan() ,public void checkRename() ,public void close(com.lealone.db.session.ServerSession) ,public int compareRows(com.lealone.db.result.SearchRow, com.lealone.db.result.SearchRow) ,public com.lealone.db.index.Cursor find(com.lealone.db.session.ServerSession, CursorParameters<com.lealone.db.result.SearchRow>) ,public com.lealone.db.index.Cursor findDistinct(com.lealone.db.session.ServerSession) ,public com.lealone.db.result.SearchRow findFirstOrLast(com.lealone.db.session.ServerSession, boolean) ,public int[] getColumnIds() ,public int getColumnIndex(com.lealone.db.table.Column) ,public com.lealone.db.table.Column[] getColumns() ,public java.lang.String getCreateSQL() ,public long getDiskSpaceUsed() ,public com.lealone.db.index.IndexColumn[] getIndexColumns() ,public com.lealone.db.index.IndexType getIndexType() ,public long getMemorySpaceUsed() ,public java.lang.String getPlanSQL() ,public com.lealone.db.result.Row getRow(com.lealone.db.session.ServerSession, long) ,public com.lealone.db.table.Table getTable() ,public com.lealone.db.DbObjectType getType() ,public boolean isHidden() ,public boolean isInMemory() ,public boolean isRowIdIndex() ,public boolean needRebuild() ,public void remove(com.lealone.db.session.ServerSession) ,public void removeChildrenAndResources(com.lealone.db.session.ServerSession, com.lealone.db.lock.DbObjectLock) ,public boolean supportsDistinctQuery() ,public void truncate(com.lealone.db.session.ServerSession) <variables>protected int[] columnIds,protected com.lealone.db.table.Column[] columns,protected com.lealone.db.index.IndexColumn[] indexColumns,protected final non-sealed com.lealone.db.index.IndexType indexType,protected final non-sealed com.lealone.db.table.Table table