I have the following object :
class Repeat{
private long startIndex;
private long endIndex;
private int length;
private float repetitions;
private float period;
private int errors;
private float percentOverlap;
public void setPercentOverlap(float percentOverlap) {
this.percentOverlap = percentOverlap;
}
public float getPercentOverlap() {
return percentOverlap;
}
.
. other sets gets etc.
.
}
When i set the percentOverlap
and add the Repeat to
ArrayList<Repeat> overlaps = new ArrayList<Repeat>();
overlaps.add(repeat);
Then when i dump this collection to a csv file. I m getting 0.0 for some of the values but not all of them. ie. 6.25 becomes 0.0. I even see this on command line.
Here is the console output:
-> before i add
->Start Index: 570433 End Index: 570465 Overlap :100.0
->Start Index: 570433 End Index: 570465 Overlap :6.25
->Start Index: 570433 End Index: 570465 Overlap :0.0
->Start Index: 570470 End Index: 570510 Overlap :85.0
->Start Index: 570470 End Index: 570510 Overlap :100.0
When i iterate the collection, this is what comes out.
Start Index: 570433 End Index: 570465 Overlap :0.0
Start Index: 570433 End Index: 570465 Overlap :0.0
Start Index: 570433 End Index: 570465 Overlap :0.0
Start Index: 570470 End Index: 570510 Overlap :100.0
Start Index: 570470 End Index: 570510 Overlap :100.0
I took out file writing, just printing to console.
Why is this happening?
Any ideas?
Thanks.