private void checkNonNullComparable ( final Object o , final int index ) { if ( o == null ) { throw new NullPointerException ( dataName [ index ] + " cannot be null" ) ; } if ( comparators [ index ] == null && ! ( o instanceof Comparable ) ) { throw new ClassCastException ( dataName [ index ] + " must be Comparable" ) ; } }
check if an object is fit to be proper input ... has to be Comparable if the comparator has not been set and non - null