source: josm/trunk/src/org/openstreetmap/josm/data/preferences/Setting.java@ 9780

Last change on this file since 9780 was 9759, checked in by Don-vip, 8 years ago

refactor preferences settings classes

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.preferences;
3
4/**
5 * Interface for a preference value.
6 *
7 * Implementations must provide a proper <code>equals</code> method.
8 *
9 * @param <T> the data type for the value
10 * @since 9759
11 */
12public interface Setting<T> {
13 /**
14 * Returns the value of this setting.
15 *
16 * @return the value of this setting
17 */
18 T getValue();
19
20 /**
21 * Check if the value of this Setting object is equal to the given value.
22 * @param otherVal the other value
23 * @return true if the values are equal
24 */
25 boolean equalVal(T otherVal);
26
27 /**
28 * Clone the current object.
29 * @return an identical copy of the current object
30 */
31 Setting<T> copy();
32
33 /**
34 * Enable usage of the visitor pattern.
35 *
36 * @param visitor the visitor
37 */
38 void visit(SettingVisitor visitor);
39
40 /**
41 * Returns a setting whose value is null.
42 *
43 * Cannot be static, because there is no static inheritance.
44 * @return a Setting object that isn't null itself, but returns null
45 * for {@link #getValue()}
46 */
47 Setting<T> getNullInstance();
48}
Note: See TracBrowser for help on using the repository browser.