/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
+ * Copyright (C) 2015 The Jalview Authors
*
* This file is part of Jalview.
*
*/
package jalview.analysis;
-import java.util.*;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceGroup;
-import jalview.datamodel.*;
+import java.util.Vector;
public class Finder
{
boolean caseSensitive = false;
+ private boolean includeDescription = false;
+
boolean findAll = false;
com.stevesoft.pat.Regex regex = null;
break;
}
}
+
+ if (isIncludeDescription() && seq.getDescription() != null
+ && regex.search(seq.getDescription()))
+ {
+ idMatch.addElement(seq);
+ hasResults = true;
+ if (!findAll)
+ {
+ // stop and return the match
+ found = true;
+ break;
+ }
+ }
}
item = seq.getSequenceAsString();
{
continue;
}
-
+ // if invalid string used, then regex has no matched to/from
int sres = seq
.findPosition(resIndex
+ Integer.parseInt(spaces.elementAt(resIndex)
{
this.seqIndex = seqIndex;
}
+
+ public boolean isIncludeDescription()
+ {
+ return includeDescription;
+ }
+
+ public void setIncludeDescription(boolean includeDescription)
+ {
+ this.includeDescription = includeDescription;
+ }
}