1 | // Copyright 2012 Georg-August-Universität Göttingen, Germany |
---|
2 | // |
---|
3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
---|
4 | // you may not use this file except in compliance with the License. |
---|
5 | // You may obtain a copy of the License at |
---|
6 | // |
---|
7 | // http://www.apache.org/licenses/LICENSE-2.0 |
---|
8 | // |
---|
9 | // Unless required by applicable law or agreed to in writing, software |
---|
10 | // distributed under the License is distributed on an "AS IS" BASIS, |
---|
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
12 | // See the License for the specific language governing permissions and |
---|
13 | // limitations under the License. |
---|
14 | |
---|
15 | package de.ugoe.cs.autoquest.eventcore.guimodel; |
---|
16 | |
---|
17 | import java.io.Serializable; |
---|
18 | |
---|
19 | /** |
---|
20 | * <p> |
---|
21 | * Common interface for GUI element specifications. |
---|
22 | * </p> |
---|
23 | * |
---|
24 | * @version 1.1 |
---|
25 | * @author Patrick Harms, Steffen Herbold |
---|
26 | */ |
---|
27 | public interface IGUIElementSpec extends Serializable { |
---|
28 | |
---|
29 | /** |
---|
30 | * <p> |
---|
31 | * Returns a string representation of the GUI element type that this specification represents. |
---|
32 | * </p> |
---|
33 | * |
---|
34 | * @return |
---|
35 | */ |
---|
36 | public String getType(); |
---|
37 | |
---|
38 | /** |
---|
39 | * <p> |
---|
40 | * Returns a string array with the names of the classes in the hierarchy of the GUI element that |
---|
41 | * this specification represents. The first element is the GUI element's class, the second its |
---|
42 | * parent, the third its grand-parent, etc. |
---|
43 | * </p> |
---|
44 | * <p> |
---|
45 | * In case the class hierarchy is unknown or the GUI elements are not based on |
---|
46 | * object-orientation, this method should <code>return new String[]{getType()};</code>. |
---|
47 | * </p> |
---|
48 | * |
---|
49 | * @return |
---|
50 | */ |
---|
51 | public String[] getTypeHierarchy(); |
---|
52 | |
---|
53 | /** |
---|
54 | * <p> |
---|
55 | * Evaluates if two GUI specifications are similar. Similar means that a heuristic determines |
---|
56 | * that the two GUI specifications describe the same GUI element. |
---|
57 | * </p> |
---|
58 | * |
---|
59 | * @param other |
---|
60 | * specification whose similarity to this is evaluated |
---|
61 | * @return true if the specifications are similar; false otherwise |
---|
62 | */ |
---|
63 | public boolean getSimilarity(IGUIElementSpec other); |
---|
64 | |
---|
65 | /** |
---|
66 | * <p> |
---|
67 | * Defines that {@link IGUIElement} implementations have to define equals. |
---|
68 | * </p> |
---|
69 | * |
---|
70 | * @see Object#equals(Object) |
---|
71 | */ |
---|
72 | @Override |
---|
73 | public boolean equals(Object other); |
---|
74 | |
---|
75 | /** |
---|
76 | * <p> |
---|
77 | * Defines that {@link IGUIElement} implementations have to define hashCode. |
---|
78 | * </p> |
---|
79 | * |
---|
80 | * @see Object#hashCode() |
---|
81 | */ |
---|
82 | @Override |
---|
83 | public int hashCode(); |
---|
84 | } |
---|