Yes, you're right, loc1 should contain loc2 and return true when asked to confirm this.
Can you raise a bug report with the details you gave in your email so that we don't lose track of it? The place to go to do this is http://bugzilla.open-bio.org/enter_bug.cgi?product=BioJava cheers, Richard 2008/9/9 Augusto Fernandes Vellozo <[EMAIL PROTECTED]>: > 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 > _______________________________________________ > Biojava-l mailing list - Biojava-l@lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > -- Richard Holland, BSc Finance Director, Eagle Genomics Ltd M: +44 7500 438846 | E: [EMAIL PROTECTED] http://www.eaglegenomics.com/ _______________________________________________ Biojava-l mailing list - Biojava-l@lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l