com.jamonapi.RangeImp Maven / Gradle / Ivy
package com.jamonapi;
import java.util.List;
/**
* Due to the fact that setting ranges would cause knowledge of the ActivityStats I opted
* not to expose setRange at this point. RangeImpInt stands for Range Implementation Interface.
* This interface has some interface details I don't want to expose. Range is the public
* interface that developers can access.
*/
abstract class RangeImp implements Range, RowData, JAMonListener {
protected FrequencyDistImp[] frequencyDist;
protected RangeHolder rangeHolder;
protected boolean isLessThan=false;
abstract protected RangeImp copy(ActivityStats activityStats);
public String getFreqDistName(int count) {
return "Range"+count+"_";
}
public int getFreqDistSize() {
return (frequencyDist==null) ? 0 : frequencyDist.length;
}
public FrequencyDist[] getFrequencyDists() {
return frequencyDist;
}
public String getLastHeader() {
return (rangeHolder==null) ? "LastRange" : rangeHolder.getLastHeader();
}
public List getBasicHeader(List header) {
// this isn't called but still will return no changes (ranges don't
// participate in basic headers)
return header;
}
public List getDisplayHeader(List header) {
int size=getFreqDistSize();
for (int i=0;i