public class SortRowTM extends WrapTM
| Modifier and Type | Field and Description |
|---|---|
protected TreeMap<Integer,Integer> |
row2srcMap |
protected RowData |
rowData |
protected TreeMap<Integer,Integer> |
src2rowMap |
evSupport, tableModel, tableModelListener, tableModelListenerStarted| Constructor and Description |
|---|
SortRowTM() |
| Modifier and Type | Method and Description |
|---|---|
void |
applySort()
Применяет сортировку исходных данных, сортируя все строки исходной таблицы
|
protected void |
checkDestIndexesFast()
Быстрая проверка ключей rows2srcMap, на предмет заполнения от 0 до N
|
protected Comparator<Integer> |
createComparator(TableModel tm,
Comparator<RowData> cmpr)
Создает функцию сортировки индексов строк
|
void |
dump()
Создание дампа индексов, отображает таблицы соответствия собественных индексов (строк) на исходные и обратно
|
void |
dump(xyz.cofe.text.Output xout)
Создание дампа индексов, отображает таблицы соответствия собественных индексов (строк) на исходные и обратно
|
protected int |
fitness(xyz.cofe.collection.Func1<Boolean,Integer> skip)
Функция проверки упорядонночести
|
int |
getColumnCount() |
Comparator<RowData> |
getRowComparator()
Возвращает функцию сравнения используемую для сортировки
|
int |
getRowCount() |
protected void |
insertRow(int di,
int si)
Вставка внутренней строки
|
protected boolean |
isIndexesValid()
Проверка валидности индексов.
|
int |
mapColumnToInside(int columnIndex)
Карта отображения запрашиваемой колонки в исходную колонку.
|
int |
mapRowToInside(int rowIndex)
Карта отображения запрашиваемой строки в исходную строку.
|
int |
mapRowToOutside(int rowIndex)
Карта отображения внутреней строки на -> внешнюю
По умолчанию возвращает запрашиваемое значение.
|
protected List<TableModelEvent> |
onRowDeleted(TableModelEvent e,
int firstRow,
int lastRow)
Вызывается при событии удаления строк из оригинальной таблицы
|
protected List<TableModelEvent> |
onRowInserted(int firstRow,
int lastRow,
boolean checkDestIndexes,
boolean checkFitness) |
protected List<TableModelEvent> |
onRowInserted(TableModelEvent e,
int firstRow,
int lastRow)
Вызывается при событии добавления строк в оригинальную таблицу
|
protected List<TableModelEvent> |
onRowUpdated(TableModelEvent e,
int firstRow,
int lastRow)
Вызывается при событии обновления строк в оригинальной таблицы
|
protected List<TableModelEvent> |
onTableChanged(TableModelEvent e)
Вызывается при полном изменении оригинальной таблицы включая структуру
|
void |
setRowComparator(Comparator<RowData> rowComparator)
Указыавет функцию сравнения используемую для сортировки
|
void |
setTableModel(TableModel tableModel)
Указывает исходную модель таблицы
|
protected void |
shiftOnDeleteIndexes(int from,
int toInc,
xyz.cofe.common.Reciver<Integer> deletedOutterIndexes)
Сдвиг индексов при удалении исходных
|
protected void |
shiftOnInsertIndexes(int from,
int toInc)
Сдвиг индексов при вставке исходных
|
addPropertyChangeListener, addTableModelListener, attachTMListener, deletageTMEvent, detachTMListener, fireAllChanged, fireCellChanged, fireColumnsChanged, firePropertyChange, fireRowsDeleted, fireRowsInserted, fireRowsUpdated, fireRowUpdated, fireTableModelEvent, getColumnClass, getColumnName, getListeners, getListenersCollection, getTableModel, getValueAt, isCellEditable, isSourceListen, mapColumnToOutside, propertySupport, removePropertyChangeListener, removeTableModelListener, setSourceListen, setValueAtprotected RowData rowData
public Comparator<RowData> getRowComparator()
public void setRowComparator(Comparator<RowData> rowComparator)
rowComparator - функция сравненияpublic int getRowCount()
getRowCount in interface TableModelgetRowCount in class WrapTMpublic int getColumnCount()
getColumnCount in interface TableModelgetColumnCount in class WrapTMprotected void shiftOnInsertIndexes(int from,
int toInc)
from - исходный индекс - началоtoInc - исходный индекс - конецprotected void insertRow(int di,
int si)
di - внешний индексsi - внутренний (исходный) индексprotected void shiftOnDeleteIndexes(int from,
int toInc,
xyz.cofe.common.Reciver<Integer> deletedOutterIndexes)
from - исходный индекс - началоtoInc - исходный индекс - конецdeletedOutterIndexes - удаление исходящих индексовprotected void checkDestIndexesFast()
protected boolean isIndexesValid()
public void dump()
public void dump(xyz.cofe.text.Output xout)
xout - поток для вывода дампаpublic int mapColumnToInside(int columnIndex)
WrapTMmapColumnToInside in class WrapTMcolumnIndex - индекс запрашиваемой колонкиpublic int mapRowToInside(int rowIndex)
WrapTMmapRowToInside in class WrapTMrowIndex - индекс запрашиваемой строкиpublic int mapRowToOutside(int rowIndex)
WrapTMmapRowToOutside in class WrapTMrowIndex - индекс запрашиваемой строкиpublic void setTableModel(TableModel tableModel)
setTableModel in class WrapTMtableModel - исходная модельapplySort()public void applySort()
protected Comparator<Integer> createComparator(TableModel tm, Comparator<RowData> cmpr)
tm - модель таблицы, содержащаяя исходные строкиcmpr - функция срвнения строкprotected int fitness(xyz.cofe.collection.Func1<Boolean,Integer> skip)
skip - Функция пропускаprotected List<TableModelEvent> onTableChanged(TableModelEvent e)
WrapTMonTableChanged in class WrapTMe - Исходное событиеprotected List<TableModelEvent> onRowUpdated(TableModelEvent e, int firstRow, int lastRow)
WrapTMonRowUpdated in class WrapTMe - Исходное событиеfirstRow - Начальная строкаlastRow - Конечная (включительно) строкаprotected List<TableModelEvent> onRowDeleted(TableModelEvent e, int firstRow, int lastRow)
WrapTMonRowDeleted in class WrapTMe - Исходное событиеfirstRow - Начальная строкаlastRow - Конечная (включительно) строкаprotected List<TableModelEvent> onRowInserted(TableModelEvent e, int firstRow, int lastRow)
WrapTMonRowInserted in class WrapTMe - Исходное событиеfirstRow - Начальная строкаlastRow - Конечная (включительно) строкаprotected List<TableModelEvent> onRowInserted(int firstRow, int lastRow, boolean checkDestIndexes, boolean checkFitness)
Copyright © 2019. All rights reserved.