Revision 25230

View differences:

branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/DefaultFeatureReference.java
139 139
			this.pk[i] = state.get("pk.item" + i);
140 140
		}
141 141
	}
142

  
143
	public boolean equals(Object obj) {
144
		if (!(obj instanceof DefaultFeatureReference)) {
145
			return false;
146
		}
147
		DefaultFeatureReference other = (DefaultFeatureReference) obj;
148

  
149
		FeatureStore otherStore = (FeatureStore) other.storeRef.get();
150
		FeatureStore myrStore = (FeatureStore) this.storeRef.get();
151
		if (otherStore == null || myrStore == null) {
152
			return false;
153
		}
154
		if (!myrStore.equals(otherStore)) {
155
			return false;
156
		}
157
		if (this.oid != null) {
158
			return this.oid.equals(other.oid);
159
		}
160

  
161
		for (int i = 0; i < this.pk.length; i++) {
162
			if (!this.pk[i].equals(other.pk[i])) {
163
				return false;
164
			}
165
		}
166
		return true;
167
	}
168

  
169
	public int hashCode() {
170
		if (this.oid != null) {
171
			return this.oid.hashCode();
172
		} else {
173
			StringBuffer buff = new StringBuffer();
174

  
175
			for (int i = 0; i < this.pk.length; i++) {
176
				buff.append(this.pk[i].hashCode());
177
				buff.append("$");
178
			}
179
			return buff.toString().hashCode();
180

  
181
		}
182
	}
183

  
184

  
142 185
}
branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/DefaultFeature.java
50 50

  
51 51
	public void setData(FeatureData data) {
52 52
		this.data = data;
53
		this.reference = null;
53 54
	}
54 55

  
55 56
	public FeatureData getData() {
branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/DefaultFeatureType.java
58 58
		this.hasEvaluators = other.hasEvaluators;
59 59
		this.rules = (DefaultFeatureRules) other.rules.getCopy();
60 60
		this.defaultGeometryAttributeIndex = other.defaultGeometryAttributeIndex;
61
		this.hasOID = other.hasOID;
62
		this.id = other.id; // XXX ???? copiar o no esto????
61 63
	}
62 64

  
63 65
	public String getId() {

Also available in: Unified diff