blob: bb6b185157c2e821c393aa0ac519fbf61b087ca3 [file] [log] [blame]
Simon Hunt933b1a82015-05-04 19:07:24 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Simon Hunt933b1a82015-05-04 19:07:24 -07003 *
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 Hunt933b1a82015-05-04 19:07:24 -070015 */
16
17package org.onosproject.ui.table;
18
19/**
20 * Defines a comparator for cell values.
21 */
22public 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 Huntb0582492016-09-20 18:26:38 -070027 * to, or greater than the second.
28 * <p>
Simon Hunt933b1a82015-05-04 19:07:24 -070029 * 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 Huntb0582492016-09-20 18:26:38 -070035 * @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 Hunt933b1a82015-05-04 19:07:24 -070038 * @throws ClassCastException if the arguments' types prevent them from
Simon Huntb0582492016-09-20 18:26:38 -070039 * being compared by this comparator
Simon Hunt933b1a82015-05-04 19:07:24 -070040 */
41 int compare(Object o1, Object o2);
42
43}