Revision 6888 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/ProjectMap.java

View differences:

ProjectMap.java
49 49

  
50 50
import com.iver.utiles.XMLEntity;
51 51

  
52
import java.lang.reflect.Field;
52 53
import java.text.DateFormat;
53 54

  
54 55
import java.util.Date;
......
167 168
		numMaps = xml.getIntProperty("numMaps");
168 169
		model = Layout.createLayout03(xml.getChild(0), p);
169 170
	}
171

  
172
//	public int computeSignature() {
173
//		int result = 17;
174
//
175
//		Class clazz = getClass();
176
//		Field[] fields = clazz.getDeclaredFields();
177
//		for (int i = 0; i < fields.length; i++) {
178
//			try {
179
//				String type = fields[i].getType().getName();
180
//				if (type.equals("boolean")) {
181
//					result += 37 + ((fields[i].getBoolean(this)) ? 1 : 0);
182
//				} else if (type.equals("java.lang.String")) {
183
//					Object v = fields[i].get(this);
184
//					if (v == null) {
185
//						result += 37;
186
//						continue;
187
//					}
188
//					char[] chars = ((String) v).toCharArray();
189
//					for (int j = 0; j < chars.length; j++) {
190
//						result += 37 + (int) chars[i];
191
//					}
192
//				} else if (type.equals("byte")) {
193
//					result += 37 + (int) fields[i].getByte(this);
194
//				} else if (type.equals("char")) {
195
//					result += 37 + (int) fields[i].getChar(this);
196
//				} else if (type.equals("short")) {
197
//					result += 37 + (int) fields[i].getShort(this);
198
//				} else if (type.equals("int")) {
199
//					result += 37 + fields[i].getInt(this);
200
//				} else if (type.equals("long")) {
201
//					long f = fields[i].getLong(this) ;
202
//					result += 37 + (f ^ (f >>> 32));
203
//				} else if (type.equals("float")) {
204
//					result += 37 + Float.floatToIntBits(fields[i].getFloat(this));
205
//				} else if (type.equals("double")) {
206
//					long f = Double.doubleToLongBits(fields[i].getDouble(this));
207
//					result += 37 + (f ^ (f >>> 32));
208
//				} else {
209
//					Object obj = fields[i].get(this);
210
//					result += 37 + ((obj != null)? obj.hashCode() : 0);
211
//				}
212
//			} catch (Exception e) { e.printStackTrace(); }
213
//
214
//		}
215
//		return result;
216
//	}
170 217
}

Also available in: Unified diff