X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FFinder.java;h=72097e0209687a4e4cbdab1c83ea25bb6b7d2447;hb=4d7f98a6dd54d9863ba449ec79dcd95d25ed863d;hp=61e57096168ac70eeabab6d8d813f97c415f175d;hpb=c3d80a77b6782d563325e9fed92c8de371e07188;p=jalview.git diff --git a/src/jalview/analysis/Finder.java b/src/jalview/analysis/Finder.java index 61e5709..72097e0 100644 --- a/src/jalview/analysis/Finder.java +++ b/src/jalview/analysis/Finder.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -42,6 +42,8 @@ public class Finder boolean caseSensitive = false; + private boolean includeDescription = false; + boolean findAll = false; com.stevesoft.pat.Regex regex = null; @@ -150,7 +152,8 @@ public class Finder } } - if (regex.search(seq.getDescription())) + if (isIncludeDescription() && seq.getDescription() != null + && regex.search(seq.getDescription())) { idMatch.addElement(seq); hasResults = true; @@ -203,7 +206,7 @@ public class Finder { continue; } -// if invalid string used, then regex has no matched to/from + // if invalid string used, then regex has no matched to/from int sres = seq .findPosition(resIndex + Integer.parseInt(spaces.elementAt(resIndex) @@ -373,4 +376,14 @@ public class Finder { this.seqIndex = seqIndex; } + + public boolean isIncludeDescription() + { + return includeDescription; + } + + public void setIncludeDescription(boolean includeDescription) + { + this.includeDescription = includeDescription; + } }