src/sap.ui.table/src/sap/ui/table/TableColumnUtils.js
function(oColumn, iNewIndex) {
			var oTable = oColumn.getParent(),
				iCurrentIndex = oTable.indexOfColumn(oColumn),
				aColumns = oTable.getColumns();

			if (iNewIndex > iCurrentIndex) {
				// The index is always given for the current table setup
				// -> A move consists of a remove and an insert, so if a column is moved to a higher index the index must be shifted
				iNewIndex--;
			}
			if (iNewIndex < 0) {
				iNewIndex = 0;
			} else if (iNewIndex > aColumns.length) {
				iNewIndex = aColumns.length;
			}

			return iNewIndex;
		}
function(oColumn, iNewIndex) {
			var oTable = oColumn.getParent(),
				iCurrentIndex = oTable.indexOfColumn(oColumn),
				aColumns = oTable.getColumns();

			if (iNewIndex > iCurrentIndex) {
				// The index is always given for the current table setup
				// -> A move consists of a remove and an insert, so if a column is moved to a higher index the index must be shifted
				iNewIndex--;
			}
			if (iNewIndex < 0) {
				iNewIndex = 0;
			} else if (iNewIndex > aColumns.length) {
				iNewIndex = aColumns.length;
			}

			return iNewIndex;
		}
function ( oColumn , iNewIndex ) { var oTable = oColumn . getParent ( ) , iCurrentIndex = oTable . indexOfColumn ( oColumn ) , aColumns = oTable . getColumns ( ) ; if ( iNewIndex > iCurrentIndex ) { // The index is always given for the current table setup // -> A move consists of a remove and an insert, so if a column is moved to a higher index the index must be shifted iNewIndex -- ; } if ( iNewIndex < 0 ) { iNewIndex = 0 ; } else if ( iNewIndex > aColumns . length ) { iNewIndex = aColumns . length ; } return iNewIndex ; }
Checks and adapts the given index if needed.

@param {sap.ui.table.Column} oColumn Column of the table.
@param {int} iNewIndex The desired new index of the column in the current table setup.
@returns {int} The corrected index.
@private
Checks and adapts the given index if needed .