Returns the sort order of the specified column in the given table,
or null if the column is not sorted

@param table The table
@param column The column
@return The sort order
484786
private static SortOrder getSortOrder(JTable table, int column)
    {
        List<? extends SortKey> sortKeys = table.getRowSorter().getSortKeys();
        for (int i=0; i<sortKeys.size(); i++)
        {
            SortKey sortKey = sortKeys.get(i);
            if (sortKey.getColumn() == table.convertColumnIndexToModel(column))
            {
                return sortKey.getSortOrder();                        
            }
        }
        return null;
    }
310145
public function sort(Table $table)
    {
        $column = $table->getSortColumn();
        $dir = $table->getSortDir();

        if (!$column)
            return;

        $sqlId = null;
        foreach ($table->getColumns() as $id => $params) {
            if ($id == $column) {
                $sqlId = $params['sql_id'];
                break;
            }
        }

        if (!$sqlId)
            throw new \Exception("No 'sql_id' for column: $column");

        $this->sqlOrderBy = $sqlId . " " . $dir;
        return $this;
    }
674683
private Table sortOn(IntComparator rowComparator) {
        Table newTable = emptyCopy(rowCount());

        int[] newRows = rows();
        IntArrays.parallelQuickSort(newRows, rowComparator);

        Rows.copyRowsToTable(newRows, this, newTable);
        return newTable;
    }
1028259
int getElementID(int column) {
        if (cells[column] == null) return NULL;
        else if (Cell.class.isInstance(cells[column])) return CELL;
        else if (Table.class.isInstance(cells[column])) return TABLE;
        
        return -1;
    }
552667
public Integer getInt(String column) {
		Number n = getNumber(column);
		return n != null ? n.intValue() : null;
	}
458505
private static Sort first(String columnName, Sort.Order order) {
        return Sort.on(columnName, order);
    }
602158
void deleteColumn(int column) {
        if ((column >= columns) || (column < 0)) {
            throw new IndexOutOfBoundsException("getCell at illegal index : " + column);
        }
        columns--;
        boolean newReserved[] = new boolean[columns];
        Object newCells[] = new Cell[columns];
        
        for (int i = 0; i < column; i++) {
            newReserved[i] = reserved[i];
            newCells[i] = cells[i];
            if (newCells[i] != null && (i + ((Cell) newCells[i]).getColspan() > column)) {
                ((Cell) newCells[i]).setColspan(((Cell) cells[i]).getColspan() - 1);
            }
        }
        for (int i = column; i < columns; i++) {
            newReserved[i] = reserved[i + 1];
            newCells[i] = cells[i + 1];
        }
        if (cells[column] != null && ((Cell) cells[column]).getColspan() > 1) {
            newCells[column] = cells[column];
            ((Cell) newCells[column]).setColspan(((Cell) newCells[column]).getColspan() - 1);
        }
        reserved = newReserved;
        cells = newCells;
    }
932949
@Override
    public void orderRows(final OrderBy ob) {
        if (ob != null) {
            ob.setMetaData(getMetaData());
            ob.setParser(parser);
            Collections.sort(rows, ob);
            goTop();
        }
    }
99424
public void sort(final int sortCol, final boolean sortAsc) {
		int[] rowIndexMappings = getTableModel().sort(sortCol, sortAsc);
		getOrCreateComponentModel().rowIndexMapping = rowIndexMappings;

		setSort(sortCol, sortAsc);

		if (rowIndexMappings == null) {
			// There's no way to correlate the previously selected row indices
			// with the new order of rows, so we need to clear out the selection.
			setSelectedRows(null);
			setExpandedRows(null);
		}
	}
488214
public function orderBy($column, $type = Order::ASC)
    {
        if (null !== $return = $this->validateMethodCall()) {
            return $return;
        }

        $this->orderBy[] = [$column, $type];

        return $this;
    }
295235
private int[] getColumnList(OrderedHashSet set, Table table) {
        if (set == null) {
            return null;
        }
        return table.getColumnIndexes(set);
    }
1325211
public boolean hasTableOrColumnCaseSensitive(String table, String column) {

        boolean result = false;
        ResultSet set = null;

        try {
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(column)) {
                // Check if the column is given
                set = m_con.getMetaData().getColumns(null, null, table, column);
                if (set.next()) {
                    String colname = set.getString("COLUMN_NAME");
                    if (colname.equalsIgnoreCase(column)) {
                        result = true; // The column is available
                    }
                }
            } else if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(table)) {
                // Check the table
                set = m_con.getMetaData().getTables(null, null, table, null);
                if (set.next()) {
                    String tablename = set.getString("TABLE_NAME");
                    if (tablename.equalsIgnoreCase(table)) {
                        result = true;
                    }
                }
            }
        } catch (SQLException e) {
            e.printStackTrace();
            result = false;
        } finally {
            try {
                if (set != null) {
                    set.close();
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
        return result;
    }
659524
@SuppressWarnings("unchecked")
	public <T> T get(String column, Object defaultValue) {
		Object result = getColumns().get(column);
		return (T)(result != null ? result : defaultValue);
	}
776752
public Table sortOn(int... columnIndexes) {
        List<String> names = new ArrayList<>();
        for (int i : columnIndexes) {
            if (i >= 0) {
                names.add(columnList.get(i).name());
            } else {
                names.add("-" + columnList.get(-i).name());
            }
        }
        return sortOn(names.toArray(new String[names.size()]));
    }
941204
def order_table_columns(table: Table, column_names: list) -> Table:
    """"""

    unordered_columns = table.column_names
    index_order = (unordered_columns.index(name) for name in column_names)
    ordered_columns = [table.columns[i] for i in index_order]
    ordered_pkey_names = [column for column in column_names
                          if column in table.primary_key_columns]
    primary_key = PrimaryKey(ordered_pkey_names)

    return Table(table.name, ordered_columns, primary_key, table.schema)
277404
private static int getSortPriority(JTable table, int column)
    {
        List<? extends SortKey> sortKeys = table.getRowSorter().getSortKeys();
        for (int i=0; i<sortKeys.size(); i++)
        {
            SortKey sortKey = sortKeys.get(i);
            if (sortKey.getColumn() == table.convertColumnIndexToModel(column))
            {
                return i;                        
            }
        }
        return -1;
    }
1118983
private static Sort getSort(String... columnNames) {
        Sort key = null;
        for (String s : columnNames) {
            if (key == null) {
                key = first(s, Sort.Order.DESCEND);
            } else {
                key.next(s, Sort.Order.DESCEND);
            }
        }
        return key;
    }