Revision 1259 org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.algorithm/org.gvsig.geoprocess.algorithm.dissolve/src/main/java/org/gvsig/geoprocess/algorithm/dissolve/DissolveRule.java

View differences:

DissolveRule.java
37 37
 * a given (and single) field.
38 38
 */
39 39
public class DissolveRule implements IDissolveRule {
40
	protected int                    indexField           = -1;
40
	protected String                    nameField           = null;
41 41
	private HashMap<String, String>  funcMap              = null;
42 42
	
43
	public DissolveRule(int indexField, HashMap<String, String> funcMap) {
44
		this.indexField = indexField;
43
	public DissolveRule(String nameField, HashMap<String, String> funcMap) {
44
		this.nameField = nameField;
45 45
		this.funcMap = funcMap;
46 46
	}
47 47
	
......
50 50
	 * @see org.gvsig.geoprocess.algorithm.dissolve.IDissolveCriteria#verifyIfDissolve(com.vividsolutions.jts.geom.Geometry, com.vividsolutions.jts.geom.Geometry, org.gvsig.fmap.dal.feature.Feature)
51 51
	 */
52 52
	public boolean verifyIfDissolve(Geometry g1, Geometry g2, Feature f1, Feature f2) {
53
		Object obj1 = f1.get(indexField);
54
		Object obj2 = f2.get(indexField);
53
		Object obj1 = f1.get(nameField);
54
		Object obj2 = f2.get(nameField);
55 55
		return compareTo(obj1, obj2);
56 56
	}
57 57
	
......
115 115
	 * (non-Javadoc)
116 116
	 * @see org.gvsig.geoprocess.algorithm.dissolve.IDissolveCriteria#getIndexField()
117 117
	 */
118
	public int getIndexField() {
119
		return indexField;
118
	public String getFieldName() {
119
		return nameField;
120 120
	}
121 121

  
122 122
}

Also available in: Unified diff