Statistics
| Revision:

root / org.gvsig.toolbox / trunk / org.gvsig.toolbox / org.gvsig.toolbox.algorithm / src / main / java / es / unex / sextante / gridCategorical / fragstatsDiversity / ClassInfo.java @ 59

History | View | Annotate | Download (835 Bytes)

1
package es.unex.sextante.gridCategorical.fragstatsDiversity;
2

    
3
public class ClassInfo {
4

    
5
   private double m_dArea    = 0;
6
   private int    m_iPatches = 0;
7
   private double m_dTotalLandscapeArea;
8

    
9

    
10
   public ClassInfo() {}
11

    
12

    
13
   public void setTotalLandscapeArea(final double dArea) {
14

    
15
      m_dTotalLandscapeArea = dArea;
16

    
17
   }
18

    
19

    
20
   public void add(final PatchInfo info) {
21

    
22
      m_iPatches++;
23
      m_dArea += info.getArea();
24

    
25

    
26
   }
27

    
28

    
29
   public double getTotalArea() {
30

    
31
      return m_dArea;
32

    
33
   }
34

    
35

    
36
   public double getPercentageOfLandscape() {
37

    
38
      return m_dArea / m_dTotalLandscapeArea * 100;
39

    
40
   }
41

    
42

    
43
   public int getPatchesCount() {
44

    
45
      return m_iPatches;
46

    
47
   }
48

    
49

    
50
   public double getPatchDensity() {
51

    
52
      return m_iPatches / m_dTotalLandscapeArea * 100;
53

    
54
   }
55

    
56
}