~ubuntu-branches/ubuntu/oneiric/mkgmap/oneiric

« back to all changes in this revision

Viewing changes to src/uk/me/parabola/mkgmap/reader/osm/StyleInfo.java

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine, Andreas Putzo, Francesco Paolo Lovergine
  • Date: 2009-07-16 11:10:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090716111016-yycxqya1f26xmti7
Tags: 0.0.0+svn1067-1
[ Andreas Putzo ]
* New upstream snapshot.
* Added ${misc:Depends} among dependencies to fix a lintian warning.
* Bumped debhelper compatibility level to 7.
* Updated long description.
* Updated Homepage in debian/control, debian/copyright, debian/watch.
* Added numerous files from /doc to debian/docs.
* Mentioned Bernhard Heibler in debian/copyright and updated copyright
  year of software and packaging.
* Bumped policy to 3.8.2, without changes.
* Added DM-Upload-Allowed to debian/control.

[ Francesco Paolo Lovergine ]
* Added me as Uploader to avoid possible inappropriate NMU notices.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 */
17
17
package uk.me.parabola.mkgmap.reader.osm;
18
18
 
19
 
import uk.me.parabola.log.Logger;
20
 
 
21
19
/**
22
20
 * Information about a style.  This is so style authors can include
23
21
 * descriptions of their styles within the style itself.
25
23
 * @author Steve Ratcliffe
26
24
 */
27
25
public class StyleInfo {
28
 
        private static final Logger log = Logger.getLogger(StyleInfo.class);
29
 
 
30
 
        private String version = "";
31
 
        private String description = "No description available";
32
 
        private String longDescription = "";
33
 
 
34
 
        void readInfo(WordScanner ws) {
35
 
                while (!ws.isEndOfFile()) {
36
 
                        String word = ws.nextWord();
37
 
                        if (word.equals("description"))
38
 
                                fetchSummary(ws);
39
 
                        else if (word.equals("version")) {
40
 
                                fetchVersion(ws);
41
 
                        }
42
 
                }
43
 
        }
44
 
 
45
 
        private void fetchVersion(WordScanner ws) {
46
 
                if (ws.hasNextSymbol())
47
 
                        ws.nextSymbol();
48
 
 
49
 
                version = ws.nextLine();
50
 
                log.debug("file info: set version to", version);
51
 
        }
52
 
 
53
 
        private void fetchSummary(WordScanner ws) {
54
 
                if (ws.hasNextSymbol())
55
 
                        ws.nextSymbol();
56
 
                
57
 
                description = ws.nextLine();
58
 
                log.debug("file info: set description to", description);
59
 
        }
60
 
 
61
 
        public String getDescription() {
62
 
                return description;
 
26
 
 
27
        private String version;
 
28
        private String summary;
 
29
        private String longDescription;
 
30
        private String baseStyleName;
 
31
 
 
32
 
 
33
        public String getSummary() {
 
34
                return summary == null ? "No summary available" : summary.trim();
63
35
        }
64
36
 
65
37
        public String getVersion() {
66
 
                return version;
 
38
                return version == null ? "1" : version.trim();
67
39
        }
68
40
 
69
41
        public String getLongDescription() {
70
 
                return longDescription;
 
42
                return longDescription != null ? longDescription.trim() : "";
 
43
        }
 
44
 
 
45
        public void setVersion(String version) {
 
46
                this.version = version;
 
47
        }
 
48
 
 
49
        public void setSummary(String summary) {
 
50
                this.summary = summary;
 
51
        }
 
52
 
 
53
        public void setLongDescription(String longDescription) {
 
54
                this.longDescription = longDescription;
 
55
        }
 
56
 
 
57
        public String getBaseStyleName() {
 
58
                return baseStyleName;
 
59
        }
 
60
 
 
61
        public void setBaseStyleName(String value) {
 
62
                this.baseStyleName = value.trim();
71
63
        }
72
64
}