Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libGeocoding / src / org / gvsig / geocoding / geommatches / MatchesParams.java @ 27057

History | View | Annotate | Download (3.04 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22

    
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2008 Prodevelop S.L  main development
26
 */
27

    
28
package org.gvsig.geocoding.geommatches;
29

    
30
import java.util.HashMap;
31
import java.util.Map;
32

    
33
/**
34
 * 
35
 * class
36
 * 
37
 * @author <a href="mailto:jsanz@prodevelop.es"> Jorge Gaspar Sanz Salinas</a>
38
 * @author <a href="mailto:vsanjaime@prodevelop.es"> Vicente Sanjaime Calvet</a>
39
 * 
40
 */
41

    
42
public class MatchesParams {
43

    
44
        private Map<String, Object> atts = new HashMap<String, Object>();
45

    
46
        private static final String RELATIVEDIST = "RELATIVEDIST";
47
        private static final String DISTANCE = "DISTANCE";
48
        private static final String OFFSET = "OFFSET";
49

    
50
        /**
51
         * Constructor class
52
         */
53
        public MatchesParams() {
54
                setDistance(null);
55
                setRelativeDistance(null);
56
                setOffset(null);
57
        }
58

    
59
        /**
60
         * Set the distance from initial node
61
         * 
62
         * @param distance
63
         */
64
        public void setDistance(Long distance) {
65
                setAttribute(DISTANCE, distance);
66
        }
67

    
68
        /**
69
         * Set the relative distance from the total distance
70
         * 
71
         * @param relative
72
         */
73
        public void setRelativeDistance(Integer relative) {
74
                setAttribute(RELATIVEDIST, relative);
75
        }
76

    
77
        /**
78
         * Set the offset distance from the way If the value is positive the offset
79
         * is in the right side If the value is negative the offset is in the left
80
         * side
81
         * 
82
         * @param offset
83
         */
84
        public void setOffset(Double offset) {
85
                setAttribute(OFFSET, offset);
86
        }
87

    
88
        /**
89
         * Get the distance
90
         * 
91
         * @return
92
         */
93
        public Long getDistance() {
94
                return (Long) getAttribute(DISTANCE);
95
        }
96

    
97
        /**
98
         * Get the relative distance in percentage value
99
         * 
100
         * @return
101
         */
102
        public Integer getRelativeDistance() {
103
                return (Integer) getAttribute(RELATIVEDIST);
104
        }
105

    
106
        /**
107
         * Get the distance from the way If the value is positive the offset is in
108
         * the right side If the value is negative the offset is in the left side
109
         * 
110
         * @return
111
         */
112
        public Double getOffset() {
113
                return (Double) getAttribute(OFFSET);
114
        }
115

    
116
        private Object getAttribute(Object key) {
117
                return this.atts.get(key);
118
        }
119

    
120
        private void setAttribute(String name, Object value) {
121
                this.atts.put(name, value);
122

    
123
        }
124

    
125
}