{@inheritDoc}

@param row1 A {@link Row}.
@param row2 A {@link Row}.
@return A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater
than the second according to a Lucene {@link Sort}.
771608
@Override
    public int compare(Row row1, Row row2) {
        Columns columns1 = rowMapper.columns(row1);
        Columns columns2 = rowMapper.columns(row2);
        return comparatorChain.compare(columns1, columns2);
    }
385964
public static ExtractFromRow extractorWith( final ExtractFromRow first,
                                                final ExtractFromRow second ) {
        final TypeFactory<?> type = Tuples.typeFactory(first.getType(), second.getType());
        return new ExtractFromRow() {
            @Override
            public TypeFactory<?> getType() {
                return type;
            }

            @Override
            public Object getValueInRow( RowAccessor row ) {
                return Tuples.tuple(first.getValueInRow(row), second.getValueInRow(row));
            }
        };
    }
830588
public static final <T extends Comparable<T>> int comparator(T val1, T val2) {
		if(val1 == null) {
			return val2 == null? 0 : -1;
		} else {
			return val2 == null? 1 : val1.compareTo(val2);
		}
	}
1281799
public static int getFirstRow(RowSelection selection) {
		return (selection == null || selection.getFirstRow() == null) ? 0 : selection.getFirstRow();
	}
245802
public synchronized V getCell(int columnIndex, int rowIndex) {
        if(rowIndex < 0 || columnIndex < 0) {
            throw new IndexOutOfBoundsException("Invalid row or column index: " + rowIndex + " " + columnIndex);
        }
        else if (rowIndex >= getRowCount()) {
            throw new IndexOutOfBoundsException("TableModel has " + getRowCount() + " rows, invalid access at rowIndex " + rowIndex);
        }
        if(columnIndex >= getColumnCount()) {
            throw new IndexOutOfBoundsException("TableModel has " + columnIndex + " columns, invalid access at columnIndex " + columnIndex);
        }
        return rows.get(rowIndex).get(columnIndex);
    }
319247
protected Object getTopRowBean(final List<Integer> row) {
		// Get root level
		List<?> lvl = getBeanList();
		if (lvl == null || lvl.isEmpty()) {
			return null;
		}

		// Get root row bean (ie top level)
		int rowIdx = row.get(0);
		Object rowData = lvl.get(rowIdx);
		return rowData;
	}
1143974
private static int getIndexOfPair(String value, Map<Integer, String> row_data) {
        for(Integer i : row_data.keySet()) {
            if(row_data.get(i).equals(value)) {
                return i.intValue();
            }
        } 
        return -1;
    }
398193
public int nz_index( int row , int col ) {
        int col0 = col_idx[col];
        int col1 = col_idx[col+1];

        for (int i = col0; i < col1; i++) {
            if( nz_rows[i] == row ) {
                return i;
            }
        }
        return -1;
    }
102072
public static List<Integer> rowIndexStringToList(final String row) {
		if (row == null) {
			return null;
		}

		List<Integer> rowIndex = new ArrayList<>();

		try {

			// Convert StringId to array
			String[] rowIdString = row.split(INDEX_DELIMITER);
			for (int i = 0; i < rowIdString.length; i++) {
				rowIndex.add(Integer.parseInt(rowIdString[i]));
			}
		} catch (NumberFormatException e) {
			LOG.warn("Invalid row id: " + row);
		}

		return rowIndex;
	}
319941
@SuppressWarnings("unchecked")
    final int compare(Object k1, Object k2) {
        return comparator==null ? ((Comparable<? super K>)k1).compareTo((K)k2)
            : comparator.compare((K)k1, (K)k2);
    }
58582
private void checkIndices(int row, int col) {
        if (row < 0 || col < 0 || row >= rows || col >= columns) {
            throw new IndexOutOfBoundsException();
        }
    }
1334864
public int[] getRow(int rowIndex) {
        if (isCompacted) {
            throw new IllegalStateException(
                    "Illegal Invocation of the method after compact()");
        }
        if (rowIndex < 0 || rowIndex > rows) {
            throw new IllegalArgumentException("rowIndex out of bound!");
        }
        int[] rowToReturn = new int[columns - 2];
        System.arraycopy(v, rowIndex * columns + 2, rowToReturn, 0,
                         columns - 2);
        return rowToReturn;
    }
272757
@Override
  public IndexedInts getRow()
  {
    final IndexedInts row = selector.getRow();

    if (row.size() == 1) {
      if (nullAdjustment == 0) {
        return row;
      } else {
        nullAdjustedRow.setValue(row.get(0) + nullAdjustment);
        return nullAdjustedRow;
      }
    } else {
      // Can't handle non-singly-valued rows in expressions.
      // Treat them as nulls until we think of something better to do.
      return ZeroIndexedInts.instance();
    }
  }
286327
public static int findRow(DenseMatrix64F m, double... row)
    {
        int cols = m.numCols;
        if (row.length != cols)
        {
            throw new IllegalArgumentException("illegal column count");
        }
        double[] d = m.data;
        int rows = m.numRows;
        for (int r=0;r<rows;r++)
        {
            boolean eq=true;
            for (int c=0;c<cols;c++)
            {
                if (d[cols*r+c] != row[c])
                {
                    eq = false;
                    break;
                }
            }
            if (eq)
            {
                return r;
            }
        }
        return -1;
    }
573704
function caseInsensitiveSorter(pattern1, pattern2) {
    pattern1 = pattern1.toLowerCase();
    pattern2 = pattern2.toLowerCase();

    if (pattern1 === pattern2)
        return 0;

    return pattern1 > pattern2 ? 1 : -1;
}
416918
public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>> int compare(T1 a1, T1 b1, T2 a2, T2 b2) {
        int res = N.compare(a1, b1);

        return res == 0 ? N.compare(a2, b2) : res;
    }
246913
public Vector3f getRow(int row, Vector3f dest) throws IndexOutOfBoundsException {
        switch (row) {
        case 0:
            dest.x = m00;
            dest.y = m10;
            dest.z = m20;
            break;
        case 1:
            dest.x = m01;
            dest.y = m11;
            dest.z = m21;
            break;
        case 2:
            dest.x = m02;
            dest.y = m12;
            dest.z = m22;
            break;
        default:
            throw new IndexOutOfBoundsException();
        }
        
        return dest;
    }