comparator.java

来自「BOOK:Beginning Algorithms Code Example」· Java 代码 · 共 18 行

JAVA
18
字号
package com.wrox.algorithms.sorting;/** * A generice interface for comparing two object for order. * */public interface Comparator {    /**     * Compares two objects for order.     *     * @param left The object on the 'left' of the comparison.     * @param right The object on the 'right' of the comparison.     * @return <0, 0, >0 if left<right, left == right or left>right respectively.     * @throws ClassCastException if the type of either object prevents them from being compared.     */    public int compare(Object left, Object right) throws ClassCastException;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?