Simon Hunt | 933b1a8 | 2015-05-04 19:07:24 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | * |
| 16 | */ |
| 17 | |
| 18 | package org.onosproject.ui.table; |
| 19 | |
| 20 | /** |
| 21 | * Defines a comparator for cell values. |
| 22 | */ |
| 23 | public interface CellComparator { |
| 24 | |
| 25 | /** |
| 26 | * Compares its two arguments for order. Returns a negative integer, |
| 27 | * zero, or a positive integer as the first argument is less than, equal |
| 28 | * to, or greater than the second.<p> |
| 29 | * |
| 30 | * Note that nulls are permitted, and should be sorted to the beginning |
| 31 | * of an ascending sort; i.e. null is considered to be "smaller" than |
| 32 | * non-null values. |
| 33 | * |
| 34 | * @see java.util.Comparator#compare(Object, Object) |
| 35 | * |
| 36 | * @param o1 the first object to be compared. |
| 37 | * @param o2 the second object to be compared. |
| 38 | * @return a negative integer, zero, or a positive integer as the |
| 39 | * first argument is less than, equal to, or greater than the |
| 40 | * second. |
| 41 | * @throws ClassCastException if the arguments' types prevent them from |
| 42 | * being compared by this comparator. |
| 43 | */ |
| 44 | int compare(Object o1, Object o2); |
| 45 | |
| 46 | } |