source: josm/trunk/src/org/openstreetmap/josm/data/preferences/ParametrizedCollectionProperty.java@ 3715

Last change on this file since 3715 was 3246, checked in by jttt, 14 years ago

Add simple wrapper for preferences, add projection changed event (will be used later to replace CachedLatLon)

  • Property svn:mime-type set to text/plain
File size: 728 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.preferences;
3
4import java.util.Collection;
5
6import org.openstreetmap.josm.Main;
7
8public abstract class ParametrizedCollectionProperty {
9
10 private final Collection<String> defaultValue;
11
12 public ParametrizedCollectionProperty(Collection<String> defaultValue) {
13 this.defaultValue = defaultValue;
14 }
15
16 protected abstract String getKey(String... params);
17
18 public Collection<String> get(String... params) {
19 return Main.pref.getCollection(getKey(params), defaultValue);
20 }
21
22 public boolean put(Collection<String> value, String... params) {
23 return Main.pref.putCollection(getKey(params), value);
24 }
25
26}
Note: See TracBrowser for help on using the repository browser.