Revision 29033 branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/impl/DefaultFeatureAttributeDescriptor.java

View differences:

DefaultFeatureAttributeDescriptor.java
21 21

  
22 22
	protected boolean allowNull;
23 23
	protected int dataType;
24
	protected DateFormat dataFormat;
24
	protected DateFormat dateFormat;
25 25
	protected Object defaultValue;
26 26
	protected int index;
27 27
	protected int maximumOccurrences;
......
65 65
	protected DefaultFeatureAttributeDescriptor() {
66 66
		this.allowNull = true;
67 67
		this.dataType = DataTypes.UNKNOWN;
68
		this.dataFormat = null;
68
		this.dateFormat = null;
69 69
		this.defaultValue = null;
70 70
		this.index = -1;
71 71
		this.maximumOccurrences = 0;
......
88 88
			DefaultFeatureAttributeDescriptor other) {
89 89
		this.allowNull = other.allowNull;
90 90
		this.dataType = other.dataType;
91
		this.dataFormat = other.dataFormat;
91
		this.dateFormat = other.dateFormat;
92 92
		this.defaultValue = other.defaultValue;
93 93
		this.index = other.index;
94 94
		this.maximumOccurrences = other.maximumOccurrences;
......
134 134
	}
135 135

  
136 136
	public DateFormat getDateFormat() {
137
		return this.dataFormat;
137
		return this.dateFormat;
138 138
	}
139 139

  
140 140
	public Object getDefaultValue() {
......
212 212
		return this.isAutomatic;
213 213
	}
214 214

  
215
	private boolean compareObject(Object a, Object b) {
216
		if (a != b) {
217
			if (a != null) {
218
				return false;
219
			}
220
			return a.equals(b);
221
		}
222
		return true;
223

  
224
	}
225

  
226
	public boolean equals(Object obj) {
227
		if (this == obj) {
228
			return true;
229
		}
230
		if (!(obj instanceof DefaultFeatureAttributeDescriptor)) {
231
			return false;
232
		}
233
		DefaultFeatureAttributeDescriptor other = (DefaultFeatureAttributeDescriptor) obj;
234

  
235
		if (this.allowNull != other.allowNull) {
236
			return false;
237
		}
238

  
239
		if (this.index != other.index) {
240
			return false;
241
		}
242

  
243
		if (!compareObject(this.name, other.name)) {
244
				return false;
245
		}
246

  
247
		if (this.dataType != other.dataType) {
248
			return false;
249
		}
250

  
251
		if (this.size != other.size) {
252
			return false;
253
		}
254

  
255
		if (!compareObject(this.defaultValue, other.defaultValue)) {
256
			return false;
257
		}
258

  
259
		if (!compareObject(this.defaultValue, other.defaultValue)) {
260
			return false;
261
		}
262

  
263
		if (this.primaryKey != other.primaryKey) {
264
			return false;
265
		}
266

  
267
		if (this.isAutomatic != other.isAutomatic) {
268
			return false;
269
		}
270

  
271
		if (this.readOnly != other.readOnly) {
272
			return false;
273
		}
274

  
275
		if (this.precision != other.precision) {
276
			return false;
277
		}
278

  
279
		if (this.maximumOccurrences != other.maximumOccurrences) {
280
			return false;
281
		}
282

  
283
		if (this.minimumOccurrences != other.minimumOccurrences) {
284
			return false;
285
		}
286
		if (this.geometryType != other.geometryType) {
287
			return false;
288
		}
289

  
290
		if (this.geometrySubType != other.geometrySubType) {
291
			return false;
292
		}
293

  
294
		if (!compareObject(this.evaluator, other.evaluator)) {
295
			return false;
296
		}
297

  
298
		if (!compareObject(this.SRS, other.SRS)) {
299
			return false;
300
		}
301

  
302
		if (!compareObject(this.dateFormat, other.dateFormat)) {
303
			return false;
304
		}
305

  
306
		if (!compareObject(this.objectClass, other.objectClass)) {
307
			return false;
308
		}
309

  
310
		return true;
311
	}
215 312
}

Also available in: Unified diff