[Biojava-l] Circular Location

Yasumasa Shigemoto yshigemo@genes.nig.ac.jp
Fri Jan 24 05:13:00 EST 2003


Hi

I use the CircularLocation and LocationTools as follows,
but it seems to return the wrong response.

import org.biojava.bio.symbol.*;

public class CircularTest {
        public static void main(String[] args) {
                try {
                        Location[] locs = new Location[10];
                        locs[0] = LocationTools.makeCircularLocation(18,24,20);
                        locs[1] = LocationTools.makeCircularLocation(18,24,20);
                        locs[2] = LocationTools.makeCircularLocation(2,8,20);
                        locs[3] = LocationTools.makeCircularLocation(4,10,20);
                        locs[4] = LocationTools.makeCircularLocation(18,23,20);
                        System.out.println(LocationTools.areEqual(locs[0], locs[1]));
                        System.out.println(LocationTools.contains(locs[0], locs[1]));
                        System.out.println(LocationTools.overlaps(locs[0], locs[2]));
                        System.out.println(LocationTools.overlaps(locs[2], locs[3]));
                        System.out.println(LocationTools.overlaps(locs[0], locs[4]));
                } catch (Exception ex) {
                        ex.printStackTrace();
                }
        }
}

> java CircularTest
true
true
false
true
false

I think the whole of result is 'true'.

Environment
biojava-1.3pre1.jar, j2sdk1.4.0

Any help would be most appreciated.

Yasumasa Shigemoto




More information about the Biojava-l mailing list