public void swapColumns ( Object columnKeyA , Object columnKeyB ) { checkFrozen ( ) ; final int columnIndexA = this . getColumnIndex ( columnKeyA ) ; final int columnIndexB = this . getColumnIndex ( columnKeyB ) ; final List < C > tmp = new ArrayList <> ( rowLength ( ) ) ; tmp . addAll ( _columnKeySet ) ; final C tmpColumnKeyA = tmp . get ( columnIndexA ) ; tmp . set ( columnIndexA , tmp . get ( columnIndexB ) ) ; tmp . set ( columnIndexB , tmpColumnKeyA ) ; _columnKeySet . clear ( ) ; _columnKeySet . addAll ( tmp ) ; _columnKeyIndexMap . forcePut ( tmp . get ( columnIndexA ) , columnIndexA ) ; _columnKeyIndexMap . forcePut ( tmp . get ( columnIndexB ) , columnIndexB ) ; if ( _initialized && _columnList . size ( ) > 0 ) { final List < E > tmpColumnA = _columnList . get ( columnIndexA ) ; _columnList . set ( columnIndexA , _columnList . get ( columnIndexB ) ) ; _columnList . set ( columnIndexB , tmpColumnA ) ; } }
Swap the positions of the two specified columns .