Last change
on this file since 3719 was 3719, checked in by bastiK, 14 years ago |
added missing license information
|
-
Property svn:eol-style
set to
native
|
File size:
955 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.mappaint;
|
---|
3 |
|
---|
4 | import org.openstreetmap.josm.data.osm.OsmUtils;
|
---|
5 |
|
---|
6 | public class Rule
|
---|
7 | {
|
---|
8 | String key;
|
---|
9 | String value;
|
---|
10 | String boolValue;
|
---|
11 |
|
---|
12 | public Rule()
|
---|
13 | {
|
---|
14 | init();
|
---|
15 | }
|
---|
16 | public Rule(Rule r)
|
---|
17 | {
|
---|
18 | key = r.key;
|
---|
19 | value = r.value;
|
---|
20 | boolValue = r.boolValue;
|
---|
21 | }
|
---|
22 | public String getKey()
|
---|
23 | {
|
---|
24 | if(value != null)
|
---|
25 | return "n" + key + "=" + value;
|
---|
26 | else if(boolValue != null)
|
---|
27 | return "b" + key + "=" + OsmUtils.getNamedOsmBoolean(boolValue);
|
---|
28 | else
|
---|
29 | return "x" + key;
|
---|
30 | }
|
---|
31 | public void init()
|
---|
32 | {
|
---|
33 | key = value = boolValue = null;
|
---|
34 | }
|
---|
35 |
|
---|
36 | public String toString()
|
---|
37 | {
|
---|
38 | return "Rule["+key+","+(boolValue != null ? "b="+boolValue:"v="+value)+"]";
|
---|
39 | }
|
---|
40 | public String toCode()
|
---|
41 | {
|
---|
42 | return "[k="+key+(boolValue != null ? ",b="+boolValue:",v="+value)+"]";
|
---|
43 | }
|
---|
44 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.