*/
public void setValue (double value) throws IllegalArgumentException
{
if ((value < minIndex) || (value > maxIndex))
throw(new IllegalArgumentException("Value "+value+" is beyond histogram range [ "+minIndex+", "+maxIndex+" ]"));
for (Bucket ptr = Head; ptr != null; ptr = ptr.cdr())
{
double bucketValue = ptr.Name();
if ((value == bucketValue) || (value <= bucketValue + width))
{
super.setValue(ptr.Name());
return;
}
}
// shouldn't get here!!
throw(new IllegalArgumentException("Something went wrong with "+value));
}