KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > calipso > reportgenerator > reportcalculator > RangeAverageOperation


1 package com.calipso.reportgenerator.reportcalculator;
2
3 /**
4  *
5  * User: jbassino
6  * Date: 12-may-2005
7  * Time: 16:44:20
8  * Calipso Software
9  */

10 public class RangeAverageOperation extends FilterOperation {
11   private float baseValue;
12   private float roofValue;
13   private float total;
14
15   public RangeAverageOperation(float from, float to, float total) {
16     super();
17     this.baseValue = from;
18     this.roofValue = to;
19     this.total = total;
20   }
21
22   protected boolean accept(SharedFloat value) {
23     float averageValue = ((value.floatValue() / total) * 100);
24     return (averageValue > baseValue && averageValue < roofValue);
25   }
26 }
27
Popular Tags