Revision 23021 trunk/libraries/libGeocoding/src/org/gvsig/geocoding/patterns/Source.java

View differences:

Source.java
7 7

  
8 8
package org.gvsig.geocoding.patterns;
9 9

  
10
import java.util.ArrayList;
11
import java.util.List;
12

  
10 13
import org.gvsig.tools.storage.IStorable;
11 14
import org.gvsig.tools.storage.IStorage;
15
import org.gvsig.tools.storage.StorageCollection;
12 16

  
13 17
// ---------------------------------/
14 18
// - Imported classes and packages -/
15 19
// ---------------------------------/
16 20

  
17

  
18 21
/**
19 22
 * Class Source.
20 23
 * 
......
29 32
	/**
30 33
	 * Field _addressstyle
31 34
	 */
32
	private org.gvsig.geocoding.patterns.Addressstyle _addressstyle;
35
	private List _addressstyle;
33 36

  
34 37
	/**
35 38
	 * Field _layersource
36 39
	 */
37
	private org.gvsig.geocoding.patterns.Layersource _layersource;
40
	private Layersource _layersource;
38 41

  
39 42
	// ----------------/
40 43
	// - Constructors -/
......
53 56
	 * 
54 57
	 * @return the value of field 'addressstyle'.
55 58
	 */
56
	public org.gvsig.geocoding.patterns..Addressstyle getAddressstyle() {
59
	public List getAddressstyle() {
57 60
		return this._addressstyle;
58
	} 
61
	}
59 62

  
60 63
	/**
61 64
	 * Returns the value of field 'layersource'.
62 65
	 * 
63 66
	 * @return the value of field 'layersource'.
64 67
	 */
65
	public org.gvsig.geocoding.patterns.Layersource getLayersource() {
68
	public Layersource getLayersource() {
66 69
		return this._layersource;
67
	} 
70
	}
68 71

  
69

  
70

  
71 72
	/**
72 73
	 * Sets the value of field 'addressstyle'.
73 74
	 * 
74 75
	 * @param addressstyle
75 76
	 *            the value of field 'addressstyle'.
76 77
	 */
77
	public void setAddressstyle(
78
			org.gvsig.geocoding.patterns.Addressstyle addressstyle) {
78
	public void setAddressstyle(List addressstyle) {
79 79
		this._addressstyle = addressstyle;
80
	} 
80
	}
81

  
81 82
	/**
82 83
	 * Sets the value of field 'layersource'.
83 84
	 * 
84 85
	 * @param layersource
85 86
	 *            the value of field 'layersource'.
86 87
	 */
87
	public void setLayersource(
88
			org.gvsig.geocoding.patterns.Layersource layersource) {
88
	public void setLayersource(Layersource layersource) {
89 89
		this._layersource = layersource;
90
	} 
90
	}
91 91

  
92

  
93

  
94 92
	public void getstate(IStorage state) {
95 93
		state.setName("source");
96 94
		state.setTheClass(this);
97
		state.put("addressstyle", this._addressstyle);
95
		state.put("addressstyle", "field", this._addressstyle);
98 96
		state.put("layersource", this._layersource);
99
		
97

  
100 98
	}
101 99

  
102 100
	public void setstate(IStorage state) {
101

  
103 102
		try {
104
			this._addressstyle = (Addressstyle)state.getObject("addressstyle");
105
			this._layersource = (Layersource)state.getObject("layersource");
103
			this._layersource = (Layersource) state.getObject("layersource");
104

  
105
			StorageCollection sto = (StorageCollection) state
106
					.getObject("addressstyle");
107
			this._addressstyle = new ArrayList();
108
			for (int i = 0; i < sto.size(); i++) {
109
				Field field = (Field) sto.get(i);
110
				this._addressstyle.add(field);
111

  
112
			}
106 113
		} catch (InstantiationException e) {
107 114
			// TODO Auto-generated catch block
108 115
			e.printStackTrace();
......
110 117
			// TODO Auto-generated catch block
111 118
			e.printStackTrace();
112 119
		}
113
		
120

  
114 121
	}
115 122

  
116 123
}

Also available in: Unified diff