root / org.gvsig.legend.aggregate / trunk / org.gvsig.legend.aggregate / org.gvsig.legend.aggregate.lib / org.gvsig.legend.aggregate.lib.impl / src / main / java / org / gvsig / legend / aggregate / lib / impl / operation / CountOperation.java @ 1848
History | View | Annotate | Download (564 Bytes)
1 |
package org.gvsig.legend.aggregate.lib.impl.operation; |
---|---|
2 |
|
3 |
import org.gvsig.fmap.dal.feature.Feature; |
4 |
import org.gvsig.legend.aggregate.lib.spi.AbstractOperation; |
5 |
|
6 |
|
7 |
public class CountOperation extends AbstractOperation { |
8 |
int count = 0; |
9 |
|
10 |
public CountOperation() {
|
11 |
super("Count", "_Count_of_grouped_features"); |
12 |
} |
13 |
|
14 |
@Override
|
15 |
public void reset() { |
16 |
count = 0;
|
17 |
} |
18 |
|
19 |
@Override
|
20 |
public void perform(Feature feature) { |
21 |
count++; |
22 |
} |
23 |
|
24 |
@Override
|
25 |
public Object getValue() { |
26 |
return count;
|
27 |
} |
28 |
|
29 |
} |