f.findNext("E.H", false, false, false); // 'E, any character, H'
// should match seq2 efH only
SearchResultsI sr = f.getSearchResults();
- assertEquals(sr.getSize(), 1);
+ assertEquals(sr.getCount(), 1);
List<SearchResultMatchI> matches = sr.getResults();
assertSame(matches.get(0).getSequence(), al.getSequenceAt(1));
assertEquals(matches.get(0).getStart(), 5);
f.findAll("E.H", false, false, false); // 'E, any character, H'
// should match seq2 efH and seq3 EFH
sr = f.getSearchResults();
- assertEquals(sr.getSize(), 2);
+ assertEquals(sr.getCount(), 2);
matches = sr.getResults();
assertSame(matches.get(0).getSequence(), al.getSequenceAt(1));
assertSame(matches.get(1).getSequence(), al.getSequenceAt(2));
*/
f.findNext("9", false, false, false);
SearchResultsI sr = f.getSearchResults();
- assertEquals(sr.getSize(), 1);
+ assertEquals(sr.getCount(), 1);
List<SearchResultMatchI> matches = sr.getResults();
assertSame(matches.get(0).getSequence(), al.getSequenceAt(0));
assertEquals(matches.get(0).getStart(), 9);
al.getSequenceAt(0).setName("Q9XA0");
f.findAll("9", false, false, false);
sr = f.getSearchResults();
- assertEquals(sr.getSize(), 2);
+ assertEquals(sr.getCount(), 2);
matches = sr.getResults();
assertSame(matches.get(0).getSequence(), al.getSequenceAt(0));
assertSame(matches.get(1).getSequence(), al.getSequenceAt(3));
PA.setValue(f, "residueIndex", 0);
f.findNext("e", false, false, false); // matches in sequence
assertTrue(f.getIdMatches().isEmpty());
- assertEquals(f.getSearchResults().getSize(), 1);
+ assertEquals(f.getSearchResults().getCount(), 1);
List<SearchResultMatchI> matches = f.getSearchResults().getResults();
assertEquals(matches.get(0).getStart(), 5);
assertEquals(matches.get(0).getEnd(), 5);
assertSame(f.getIdMatches().get(0), al2.getSequenceAt(0));
assertSame(f.getIdMatches().get(1), al2.getSequenceAt(1));
- assertEquals(f.getSearchResults().getSize(), 2);
+ assertEquals(f.getSearchResults().getCount(), 2);
SearchResultMatchI match = f.getSearchResults().getResults().get(0);
assertSame(match.getSequence(), al2.getSequenceAt(1));
assertEquals(match.getStart(), 5);
assertEquals(f.getIdMatches().size(), 1);
assertSame(f.getIdMatches().get(0), al2.getSequenceAt(4));
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 2);
+ assertEquals(searchResults.getCount(), 2);
SearchResultMatchI match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al2.getSequenceAt(4));
assertEquals(match.getStart(), 4);
FinderI f = new Finder(av);
f.findNext("EfH", false, false, false);
SearchResultsI searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 1);
+ assertEquals(searchResults.getCount(), 1);
SearchResultMatchI match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(1));
assertEquals(match.getStart(), 5);
f = new Finder(av);
f.findNext("I", false, false, false); // find next: seq1/16
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 1);
+ assertEquals(searchResults.getCount(), 1);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(0));
assertEquals(match.getStart(), 16);
f.findNext("I", false, false, false); // find next: seq1/18
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 1);
+ assertEquals(searchResults.getCount(), 1);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(0));
assertEquals(match.getStart(), 18);
f.findNext("I", false, false, false); // find next: seq2/8
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 1);
+ assertEquals(searchResults.getCount(), 1);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(1));
assertEquals(match.getStart(), 8);
*/
f.findNext("I", false, false, false); // find next: seq1/16
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 1);
+ assertEquals(searchResults.getCount(), 1);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(0));
assertEquals(match.getStart(), 16);
Finder f = new Finder(av);
f.findAll("M+", false, false, false);
SearchResultsI searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 1);
+ assertEquals(searchResults.getCount(), 1);
SearchResultMatchI match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(3));
assertEquals(match.getStart(), 4); // dataset sequence positions
Finder f = new Finder(av);
f.findAll("EfH", false, false, false);
SearchResultsI searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 2);
+ assertEquals(searchResults.getCount(), 2);
SearchResultMatchI match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(1));
assertEquals(match.getStart(), 5);
*/
f.findAll("I", false, false, false);
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 3);
+ assertEquals(searchResults.getCount(), 3);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(0));
assertEquals(match.getStart(), 16);
*/
f.findAll("BC", true, false, false);
SearchResultsI searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 2);
+ assertEquals(searchResults.getCount(), 2);
SearchResultMatchI match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(0));
assertEquals(match.getStart(), 9);
f = new Finder(av);
f.findAll("bc", true, false, false);
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 1);
+ assertEquals(searchResults.getCount(), 1);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(2));
assertEquals(match.getStart(), 1);
f.findNext("b", false, false, false);
assertTrue(f.getIdMatches().isEmpty());
SearchResultsI searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 1);
+ assertEquals(searchResults.getCount(), 1);
SearchResultMatchI match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(1));
assertEquals(match.getStart(), 2);
f.findNext("d", false, false, false);
assertTrue(f.getIdMatches().isEmpty());
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 1);
+ assertEquals(searchResults.getCount(), 1);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(1));
assertEquals(match.getStart(), 4);
f.findNext("d", false, false, false);
assertTrue(f.getIdMatches().isEmpty());
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 1);
+ assertEquals(searchResults.getCount(), 1);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(2));
assertEquals(match.getStart(), 3);
assertSame(f.getIdMatches().get(0), al.getSequenceAt(1));
assertSame(f.getIdMatches().get(1), al.getSequenceAt(2));
SearchResultsI searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 1);
+ assertEquals(searchResults.getCount(), 1);
SearchResultMatchI match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(2));
assertEquals(match.getStart(), 4);
f.findAll("I", false, false, false);
assertTrue(f.getIdMatches().isEmpty());
SearchResultsI searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 2);
+ assertEquals(searchResults.getCount(), 2);
SearchResultMatchI match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(0));
assertEquals(match.getStart(), 16);
Finder f = new Finder(av);
f.findAll("aaa", false, false, false);
SearchResultsI searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 2);
+ assertEquals(searchResults.getCount(), 2);
SearchResultMatchI match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(3));
assertEquals(match.getStart(), 1);
f = new Finder(av);
f.findAll("D", false, false, false);
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 1);
+ assertEquals(searchResults.getCount(), 1);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(1));
assertEquals(match.getStart(), 4);
f = new Finder(av);
f.findAll("aaa", false, false, false);
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 2);
+ assertEquals(searchResults.getCount(), 2);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(3));
assertEquals(match.getStart(), 1);
f = new Finder(av);
f.findAll("aaa", false, false, false);
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 2);
+ assertEquals(searchResults.getCount(), 2);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(3));
assertEquals(match.getStart(), 1);
f = new Finder(av);
f.findNext("H", false, false, false);
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 1);
+ assertEquals(searchResults.getCount(), 1);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(2));
assertEquals(match.getStart(), 6);
Finder f = new Finder(av);
f.findAll("[AH]", false, false, false);
SearchResultsI searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 2);
+ assertEquals(searchResults.getCount(), 2);
SearchResultMatchI match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(1));
assertEquals(match.getStart(), 1);
/*
* match of seq1 ABE made up of AB and E
+ * note only one match is counted
*/
- assertEquals(searchResults.getSize(), 2);
+ assertEquals(searchResults.getCount(), 1);
+ assertEquals(searchResults.getResults().size(), 2);
SearchResultMatchI match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(0));
assertEquals(match.getStart(), 8); // A
f = new Finder(av);
f.findNext("a.E", false, false, true);
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 2);
+ assertEquals(searchResults.getCount(), 1);
+ assertEquals(searchResults.getResults().size(), 2);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(0));
assertEquals(match.getStart(), 8); // A
f.findNext("a.E", false, false, true);
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 2);
+ assertEquals(searchResults.getCount(), 1);
+ assertEquals(searchResults.getResults().size(), 2);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(1));
assertEquals(match.getStart(), 1); // a
/*
* find all matching across two hidden column regions
- * note one 'match' is reported as three contiguous matches
+ * note one 'match' is returned as three contiguous matches
*/
f.findAll("BEG", false, false, true);
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 3);
+ assertEquals(searchResults.getCount(), 1);
+ assertEquals(searchResults.getResults().size(), 3);
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(0));
assertEquals(match.getStart(), 9); // B
av.setSelectionGroup(selection);
f.findAll("A.*H", false, false, true);
searchResults = f.getSearchResults();
- assertEquals(searchResults.getSize(), 3);
+ assertEquals(searchResults.getCount(), 1);
+ assertEquals(searchResults.getResults().size(), 3);
// match made of contiguous matches A, DE, H
match = searchResults.getResults().get(0);
assertSame(match.getSequence(), al.getSequenceAt(1));