[Biojava-l] Error in SimpleRichLocation.contains()

Augusto Fernandes Vellozo augustovmail-java at yahoo.com.br
Tue Sep 9 19:03:26 UTC 2008


Hi Everyone.

I think there is one error with the method contains in SimpleRichLocation.

If I have the locations
loc1=(1..10) ,
loc2=join(2..4, 6..8) then
loc1 contains (loc2) is true, it is right?

But....the program below prints false.
Someone knows what's happening?

Thanks a lot,

Augusto

public class Test
{
    public static void main(String[] args) {
        RichLocation loc1 = new SimpleRichLocation(new SimplePosition(1),
new SimplePosition(10), 0);
        RichLocation loc2 = new SimpleRichLocation(new SimplePosition(2),
new SimplePosition(4), 0);
        RichLocation loc3 = new SimpleRichLocation(new SimplePosition(6),
new SimplePosition(8), 0);
        ArrayList a = new ArrayList();
        a.add(loc2);
        a.add(loc3);
        CompoundRichLocation loc4 = new CompoundRichLocation(a);
        System.out.println(loc1.contains(loc4));
    }
}



-- 
Augusto F. Vellozo



-- 
Augusto F. Vellozo



More information about the Biojava-l mailing list