Simon Hunt | 933b1a8 | 2015-05-04 19:07:24 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Simon Hunt | 933b1a8 | 2015-05-04 19:07:24 -0700 | [diff] [blame] | 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. |
Simon Hunt | 933b1a8 | 2015-05-04 19:07:24 -0700 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | package org.onosproject.ui.table; |
| 18 | |
| 19 | /** |
| 20 | * Defines a comparator for cell values. |
| 21 | */ |
| 22 | public interface CellComparator { |
| 23 | |
| 24 | /** |
| 25 | * Compares its two arguments for order. Returns a negative integer, |
| 26 | * zero, or a positive integer as the first argument is less than, equal |
Simon Hunt | b058249 | 2016-09-20 18:26:38 -0700 | [diff] [blame] | 27 | * to, or greater than the second. |
| 28 | * <p> |
Simon Hunt | 933b1a8 | 2015-05-04 19:07:24 -0700 | [diff] [blame] | 29 | * Note that nulls are permitted, and should be sorted to the beginning |
| 30 | * of an ascending sort; i.e. null is considered to be "smaller" than |
| 31 | * non-null values. |
| 32 | * |
| 33 | * @see java.util.Comparator#compare(Object, Object) |
| 34 | * |
Simon Hunt | b058249 | 2016-09-20 18:26:38 -0700 | [diff] [blame] | 35 | * @param o1 the first object to be compared |
| 36 | * @param o2 the second object to be compared |
| 37 | * @return an integer representing relative ordering |
Simon Hunt | 933b1a8 | 2015-05-04 19:07:24 -0700 | [diff] [blame] | 38 | * @throws ClassCastException if the arguments' types prevent them from |
Simon Hunt | b058249 | 2016-09-20 18:26:38 -0700 | [diff] [blame] | 39 | * being compared by this comparator |
Simon Hunt | 933b1a8 | 2015-05-04 19:07:24 -0700 | [diff] [blame] | 40 | */ |
| 41 | int compare(Object o1, Object o2); |
| 42 | |
| 43 | } |