int length = locOnChr.getEnd().intValue() - locOnChr.getStart().intValue() + 1;
int end = locOnChr.getEnd().intValue(); int start = locOnChr.getStart().intValue(); int length = Math.abs(end - start) + 1;
    public void setChromosomeLocationsAndLengths() throws Exception {        Results results = PostProcessUtil.findLocationAndObjects(os, Chromosome.class,                                                        LocatedSequenceFeature.class, true);        results.setBatchSize(2000);        Iterator resIter = results.iterator();        osw.beginTransaction();        while (resIter.hasNext()) {            ResultsRow rr = (ResultsRow) resIter.next();            LocatedSequenceFeature lsf = (LocatedSequenceFeature) rr.get(1);            Location locOnChr = (Location) rr.get(2);            LocatedSequenceFeature lsfClone =                (LocatedSequenceFeature) cloneInterMineObject(lsf);            lsfClone.setChromosomeLocation(locOnChr);            if (locOnChr.getStart() != null && locOnChr.getEnd() != null) {                int length = locOnChr.getEnd().intValue() - locOnChr.getStart().intValue() + 1;                lsfClone.setLength(new Integer(length));            }            osw.store(lsfClone);        }        osw.commitTransaction();    }