Revision 24079 branches/v2_0_0_prep/libraries/libFMap_data/src/org/gvsig/fmap/data/DataQuery.java

View differences:

DataQuery.java
29 29
import java.util.HashMap;
30 30
import java.util.Map;
31 31

  
32
import org.gvsig.tools.persistence.AbstractPersistenceManager;
33
import org.gvsig.tools.persistence.PersistenceException;
34
import org.gvsig.tools.persistence.Persistent;
35
import org.gvsig.tools.persistence.PersistentState;
36

  
32 37
/**
33 38
 * Defines the properties of a collection of data, as a result of a query
34 39
 * through a DataStore.
......
39 44
 * the data, or maybe to return Data with less detail, like a point or a line
40 45
 * instead of a polygon.
41 46
 * </p>
42
 * 
47
 *
43 48
 * @author <a href="mailto:cordin@disid.com">C?sar Ordi?ana</a>
44 49
 */
45
public class DataQuery {
50
public class DataQuery implements Persistent {
46 51

  
47 52
    private double scale;
48
    
53

  
49 54
    private Map attributes = new HashMap();
50 55

  
51 56
    /**
......
57 62

  
58 63
    /**
59 64
     * Constructor with an scale.
60
     * 
65
     *
61 66
     * @param scale
62 67
     *            the scale for the data
63 68
     */
......
68 73

  
69 74
    /**
70 75
     * Returns the scale.
71
     * 
76
     *
72 77
     * @return the scale
73 78
     */
74 79
    public double getScale() {
......
77 82

  
78 83
    /**
79 84
     * Sets the scale.
80
     * 
85
     *
81 86
     * @param scale
82 87
     *            the scale to set
83 88
     */
......
87 92

  
88 93
    /**
89 94
     * Returns the value of an attribute.
90
     * 
95
     *
91 96
     * @param name
92 97
     *            of the attribute
93 98
     * @return the attribute value
......
98 103

  
99 104
    /**
100 105
     * Sets the value of an attribute.
101
     * 
106
     *
102 107
     * @param name
103 108
     *            of the attribute
104 109
     * @param value
......
108 113
        attributes.put(name, value);
109 114
    }
110 115

  
116
	public PersistentState getState() throws PersistenceException {
117
		return AbstractPersistenceManager.getState(this);
118
	}
119

  
120
	public void loadState(PersistentState state) throws PersistenceException {
121
		// FIXME: falta por terminar de implementar
122
		state.set("scale", scale);
123
	}
124

  
125
	public void setState(PersistentState state) throws PersistenceException {
126
		// FIXME: falta por terminar de implementar
127
		this.scale = state.getDouble("scale");
128
	}
129

  
111 130
}

Also available in: Unified diff