1 /*
2 * Copyright (c) 2007 Creative Sphere Limited.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 *
10 * Creative Sphere - initial API and implementation
11 *
12 */
13 package org.abstracthorizon.aequo;
14
15 /**
16 * Entry of {@link CompareModel}.
17 *
18 * @param <T> type
19 *
20 * @author Daniel Sendula
21 */
22 public interface CompareEntry<T> {
23
24 /** Column is equal to others */
25 byte EQUAL = 0;
26
27 /** Column is greater then others */
28 byte GREATER = 1;
29
30 /** Column is less then others */
31 byte LESS = -1;
32
33 /** Different than others */
34 byte DIFFERENT = -2;
35
36 /** Empty status */
37 byte EMPTY = GREATER + 1;
38
39 /** New line status - set if lines are similar */
40 byte SIMILAR = EMPTY + 1;
41
42 /** New line status - set if line is changed */
43 byte CHANGED = SIMILAR + 1;
44
45 /**
46 * Returns data array
47 * @return data array
48 */
49 T[] getData();
50
51 /**
52 * Returns data for asked column
53 * @param index column index
54 * @return data for asked column
55 */
56 T getData(int index);
57
58 /**
59 * Sets data as an array
60 * @param data sets data as an array
61 */
62 void setData(T[] data);
63
64 /**
65 * Sets data in given column
66 * @param index index of column
67 * @param data data
68 */
69 void setData(int index, T data);
70
71 /**
72 * Returns status of asked column
73 * @param column column
74 * @return status of asked column
75 *
76 * @see #EQUAL
77 * @see #GREATER
78 * @see #LESS
79 * @see #DIFFERENT
80 */
81 byte getStatus(int column);
82 }