Statistics
| Revision:

root / org.gvsig.toolbox / trunk / org.gvsig.toolbox / org.gvsig.toolbox.algorithm / src / main / java / es / unex / sextante / gridStatistics / neighborhoodMinValue / NeighborhoodMinValueAlgorithm.java @ 59

History | View | Annotate | Download (979 Bytes)

1
package es.unex.sextante.gridStatistics.neighborhoodMinValue;
2

    
3
import es.unex.sextante.core.Sextante;
4
import es.unex.sextante.gridStatistics.base.NeighborhoodStatsBaseAlgorithm;
5

    
6
public class NeighborhoodMinValueAlgorithm
7
         extends
8
            NeighborhoodStatsBaseAlgorithm {
9

    
10
   @Override
11
   public void defineCharacteristics() {
12

    
13
      setName(Sextante.getText("Minimum__neighbourhood"));
14
      setGroup(Sextante.getText("Focal_statistics"));
15
      super.defineCharacteristics();
16

    
17
   }
18

    
19

    
20
   @Override
21
   protected double processValues() {
22

    
23
      int i;
24
      double dValue;
25

    
26
      double dMin = Double.MAX_VALUE;
27

    
28
      for (i = 0; i < m_dValues.length; i++) {
29
         dValue = m_dValues[i];
30
         if (dValue != NO_DATA) {
31
            if (dValue < dMin) {
32
               dMin = dValue;
33
            }
34
         }
35
      }
36

    
37
      if (dMin == Double.MAX_VALUE) {
38
         dMin = NO_DATA;
39
      }
40

    
41
      return dMin;
42

    
43
   }
44

    
45
}