2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.datamodel;
23 import jalview.util.ShiftList;
24 import jalview.viewmodel.annotationfilter.AnnotationFilterParameter;
25 import jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField;
27 import java.util.ArrayList;
28 import java.util.Collections;
29 import java.util.List;
30 import java.util.Vector;
33 * NOTE: Columns are zero based.
35 public class ColumnSelection
38 * list of selected columns (not ordered)
40 Vector<Integer> selected = new Vector<Integer>();
43 * list of hidden column [start, end] ranges; the list is maintained in
44 * ascending start column order
46 Vector<int[]> hiddenColumns;
49 * Add a column to the selection
54 public void addElement(int col)
56 Integer column = new Integer(col);
57 if (!selected.contains(column))
59 selected.addElement(column);
64 * clears column selection
68 selected.removeAllElements();
72 * Removes value 'col' from the selection (not the col'th item)
75 * index of column to be removed
77 public void removeElement(int col)
79 Integer colInt = new Integer(col);
81 if (selected.contains(colInt))
83 // if this ever changes to List.remove(), ensure Integer not int argument
84 // as List.remove(int i) removes the i'th item which is wrong
85 selected.removeElement(colInt);
90 * removes a range of columns from the selection
93 * int - first column in range to be removed
97 public void removeElements(int start, int end)
100 for (int i = start; i < end; i++)
102 colInt = new Integer(i);
103 if (selected.contains(colInt))
105 selected.removeElement(colInt);
111 * Returns a list of selected columns. The list contains no duplicates but is
112 * not necessarily ordered.
114 public List<Integer> getSelected()
122 * index to search for in column selection
124 * @return true if Integer(col) is in selection.
126 public boolean contains(int col)
128 return selected.contains(new Integer(col));
132 * Answers true if no columns are selected, else false
134 public boolean isEmpty()
136 return selected == null || selected.isEmpty();
140 * rightmost selected column
142 * @return rightmost column in alignment that is selected
148 for (int sel : getSelected())
160 * Leftmost column in selection
162 * @return column index of leftmost column in selection
166 int min = 1000000000;
168 for (int sel : getSelected())
180 * propagate shift in alignment columns to column selection
185 * shift in edit (+ve for removal, or -ve for inserts)
187 public List<int[]> compensateForEdit(int start, int change)
189 List<int[]> deletedHiddenColumns = null;
190 for (int i = 0; i < selected.size(); i++)
192 int temp = selected.get(i);
196 // if this ever changes to List.set(), swap parameter order!!
197 selected.setElementAt(new Integer(temp - change), i);
201 if (hiddenColumns != null)
203 deletedHiddenColumns = new ArrayList<int[]>();
204 int hSize = hiddenColumns.size();
205 for (int i = 0; i < hSize; i++)
207 int[] region = hiddenColumns.elementAt(i);
208 if (region[0] > start && start + change > region[1])
210 deletedHiddenColumns.add(region);
212 hiddenColumns.removeElementAt(i);
218 if (region[0] > start)
231 this.revealHiddenColumns(0);
234 return deletedHiddenColumns;
238 * propagate shift in alignment columns to column selection special version of
239 * compensateForEdit - allowing for edits within hidden regions
244 * shift in edit (+ve for removal, or -ve for inserts)
246 private void compensateForDelEdits(int start, int change)
248 for (int i = 0; i < selected.size(); i++)
250 int temp = selected.get(i);
254 // if this ever changes to List.set(), must swap parameter order!!!
255 selected.setElementAt(new Integer(temp - change), i);
259 if (hiddenColumns != null)
261 for (int i = 0; i < hiddenColumns.size(); i++)
263 int[] region = hiddenColumns.elementAt(i);
264 if (region[0] >= start)
268 if (region[1] >= start)
272 if (region[1] < region[0])
274 hiddenColumns.removeElementAt(i--);
290 * Adjust hidden column boundaries based on a series of column additions or
291 * deletions in visible regions.
296 public ShiftList compensateForEdits(ShiftList shiftrecord)
298 if (shiftrecord != null)
300 final List<int[]> shifts = shiftrecord.getShifts();
301 if (shifts != null && shifts.size() > 0)
304 for (int i = 0, j = shifts.size(); i < j; i++)
306 int[] sh = shifts.get(i);
307 // compensateForEdit(shifted+sh[0], sh[1]);
308 compensateForDelEdits(shifted + sh[0], sh[1]);
312 return shiftrecord.getInverse();
318 * removes intersection of position,length ranges in deletions from the
319 * start,end regions marked in intervals.
325 private boolean pruneIntervalVector(final List<int[]> shifts,
326 Vector<int[]> intervals)
328 boolean pruned = false;
329 int i = 0, j = intervals.size() - 1, s = 0, t = shifts.size() - 1;
330 int hr[] = intervals.elementAt(i);
331 int sr[] = shifts.get(s);
332 while (i <= j && s <= t)
334 boolean trailinghn = hr[1] >= sr[0];
339 hr = intervals.elementAt(++i);
347 int endshift = sr[0] + sr[1]; // deletion ranges - -ve means an insert
348 if (endshift < hr[0] || endshift < sr[0])
349 { // leadinghc disjoint or not a deletion
352 sr = shifts.get(++s);
360 boolean leadinghn = hr[0] >= sr[0];
361 boolean leadinghc = hr[0] < endshift;
362 boolean trailinghc = hr[1] < endshift;
366 { // deleted hidden region.
367 intervals.removeElementAt(i);
372 hr = intervals.elementAt(i);
378 hr[0] = endshift; // clip c terminal region
379 leadinghn = !leadinghn;
395 // sr contained in hr
398 sr = shifts.get(++s);
408 return pruned; // true if any interval was removed or modified by
412 private boolean pruneColumnList(final List<int[]> shifts,
413 Vector<Integer> list)
415 int s = 0, t = shifts.size();
416 int[] sr = shifts.get(s++);
417 boolean pruned = false;
418 int i = 0, j = list.size();
419 while (i < j && s <= t)
421 int c = list.elementAt(i++).intValue();
424 if (sr[1] + sr[0] >= c)
425 { // sr[1] -ve means inseriton.
426 list.removeElementAt(--i);
443 * remove any hiddenColumns or selected columns and shift remaining based on a
444 * series of position, range deletions.
448 public void pruneDeletions(ShiftList deletions)
450 if (deletions != null)
452 final List<int[]> shifts = deletions.getShifts();
453 if (shifts != null && shifts.size() > 0)
455 // delete any intervals intersecting.
456 if (hiddenColumns != null)
458 pruneIntervalVector(shifts, hiddenColumns);
459 if (hiddenColumns != null && hiddenColumns.size() == 0)
461 hiddenColumns = null;
464 if (selected != null && selected.size() > 0)
466 pruneColumnList(shifts, selected);
467 if (selected != null && selected.size() == 0)
472 // and shift the rest.
473 this.compensateForEdits(deletions);
479 * This Method is used to return all the HiddenColumn regions
481 * @return empty list or List of hidden column intervals
483 public List<int[]> getHiddenColumns()
485 return hiddenColumns == null ? Collections.<int[]> emptyList()
490 * Return absolute column index for a visible column index
493 * int column index in alignment view
494 * @return alignment column index for column
496 public int adjustForHiddenColumns(int column)
499 if (hiddenColumns != null)
501 for (int i = 0; i < hiddenColumns.size(); i++)
503 int[] region = hiddenColumns.elementAt(i);
504 if (result >= region[0])
506 result += region[1] - region[0] + 1;
514 * Use this method to find out where a column will appear in the visible
515 * alignment when hidden columns exist. If the column is not visible, then the
516 * left-most visible column will always be returned.
518 * @param hiddenColumn
522 public int findColumnPosition(int hiddenColumn)
524 int result = hiddenColumn;
525 if (hiddenColumns != null)
531 region = hiddenColumns.elementAt(index++);
532 if (hiddenColumn > region[1])
534 result -= region[1] + 1 - region[0];
536 } while ((hiddenColumn > region[1]) && (index < hiddenColumns.size()));
537 if (hiddenColumn > region[0] && hiddenColumn < region[1])
539 return region[0] + hiddenColumn - result;
542 return result; // return the shifted position after removing hidden columns.
546 * Use this method to determine where the next hiddenRegion starts
548 public int findHiddenRegionPosition(int hiddenRegion)
551 if (hiddenColumns != null)
557 int[] region = hiddenColumns.elementAt(index);
558 if (hiddenRegion == 0)
563 gaps += region[1] + 1 - region[0];
564 result = region[1] + 1;
566 } while (index < hiddenRegion + 1);
575 * THis method returns the rightmost limit of a region of an alignment with
576 * hidden columns. In otherwords, the next hidden column.
581 public int getHiddenBoundaryRight(int alPos)
583 if (hiddenColumns != null)
588 int[] region = hiddenColumns.elementAt(index);
589 if (alPos < region[0])
595 } while (index < hiddenColumns.size());
603 * This method returns the leftmost limit of a region of an alignment with
604 * hidden columns. In otherwords, the previous hidden column.
609 public int getHiddenBoundaryLeft(int alPos)
611 if (hiddenColumns != null)
613 int index = hiddenColumns.size() - 1;
616 int[] region = hiddenColumns.elementAt(index);
617 if (alPos > region[1])
623 } while (index > -1);
630 public void hideSelectedColumns()
632 while (!selected.isEmpty())
634 int column = selected.get(0).intValue();
641 * Adds the specified column range to the hidden columns
646 public void hideColumns(int start, int end)
648 if (hiddenColumns == null)
650 hiddenColumns = new Vector<int[]>();
654 * traverse existing hidden ranges and insert / amend / append as
657 for (int i = 0; i < hiddenColumns.size(); i++)
659 int[] region = hiddenColumns.elementAt(i);
661 if (end < region[0] - 1)
664 * insert discontiguous preceding range
666 hiddenColumns.insertElementAt(new int[] { start, end }, i);
670 if (end <= region[1])
673 * new range overlaps existing, or is contiguous preceding it - adjust
676 region[0] = Math.min(region[0], start);
680 if (start <= region[1] + 1)
683 * new range overlaps existing, or is contiguous following it - adjust
684 * start and end columns
686 region[0] = Math.min(region[0], start);
687 region[1] = Math.max(region[1], end);
693 * remaining case is that the new range follows everything else
695 hiddenColumns.addElement(new int[] { start, end });
699 * Hides the specified column and any adjacent selected columns
704 public void hideColumns(int col)
707 * deselect column (whether selected or not!)
712 * find adjacent selected columns
714 int min = col - 1, max = col + 1;
715 while (contains(min))
721 while (contains(max))
728 * min, max are now the closest unselected columns
737 hideColumns(min, max);
741 * Unhides, and adds to the selection list, all hidden columns
743 public void revealAllHiddenColumns()
745 if (hiddenColumns != null)
747 for (int i = 0; i < hiddenColumns.size(); i++)
749 int[] region = hiddenColumns.elementAt(i);
750 for (int j = region[0]; j < region[1] + 1; j++)
757 hiddenColumns = null;
761 * Reveals, and marks as selected, the hidden column range with the given
766 public void revealHiddenColumns(int start)
768 for (int i = 0; i < hiddenColumns.size(); i++)
770 int[] region = hiddenColumns.elementAt(i);
771 if (start == region[0])
773 for (int j = region[0]; j < region[1] + 1; j++)
778 hiddenColumns.removeElement(region);
782 if (hiddenColumns.size() == 0)
784 hiddenColumns = null;
788 public boolean isVisible(int column)
790 if (hiddenColumns != null)
792 for (int[] region : hiddenColumns)
794 if (column >= region[0] && column <= region[1])
809 public ColumnSelection(ColumnSelection copy)
813 if (copy.selected != null)
815 selected = new Vector<Integer>();
816 for (int i = 0, j = copy.selected.size(); i < j; i++)
818 selected.addElement(copy.selected.elementAt(i));
821 if (copy.hiddenColumns != null)
823 hiddenColumns = new Vector<int[]>(copy.hiddenColumns.size());
824 for (int i = 0, j = copy.hiddenColumns.size(); i < j; i++)
827 rh = copy.hiddenColumns.elementAt(i);
830 cp = new int[rh.length];
831 System.arraycopy(rh, 0, cp, 0, rh.length);
832 hiddenColumns.addElement(cp);
842 public ColumnSelection()
846 public String[] getVisibleSequenceStrings(int start, int end,
849 int i, iSize = seqs.length;
850 String selection[] = new String[iSize];
851 if (hiddenColumns != null && hiddenColumns.size() > 0)
853 for (i = 0; i < iSize; i++)
855 StringBuffer visibleSeq = new StringBuffer();
856 List<int[]> regions = getHiddenColumns();
858 int blockStart = start, blockEnd = end;
860 int hideStart, hideEnd;
862 for (int j = 0; j < regions.size(); j++)
864 region = regions.get(j);
865 hideStart = region[0];
868 if (hideStart < start)
873 blockStart = Math.min(blockStart, hideEnd + 1);
874 blockEnd = Math.min(blockEnd, hideStart);
876 if (blockStart > blockEnd)
881 visibleSeq.append(seqs[i].getSequence(blockStart, blockEnd));
883 blockStart = hideEnd + 1;
887 if (end > blockStart)
889 visibleSeq.append(seqs[i].getSequence(blockStart, end));
892 selection[i] = visibleSeq.toString();
897 for (i = 0; i < iSize; i++)
899 selection[i] = seqs[i].getSequenceAsString(start, end);
907 * return all visible segments between the given start and end boundaries
910 * (first column inclusive from 0)
912 * (last column - not inclusive)
913 * @return int[] {i_start, i_end, ..} where intervals lie in
914 * start<=i_start<=i_end<end
916 public int[] getVisibleContigs(int start, int end)
918 if (hiddenColumns != null && hiddenColumns.size() > 0)
920 List<int[]> visiblecontigs = new ArrayList<int[]>();
921 List<int[]> regions = getHiddenColumns();
925 int hideStart, hideEnd;
927 for (int j = 0; vstart < end && j < regions.size(); j++)
929 region = regions.get(j);
930 hideStart = region[0];
933 if (hideEnd < vstart)
937 if (hideStart > vstart)
939 visiblecontigs.add(new int[] { vstart, hideStart - 1 });
941 vstart = hideEnd + 1;
946 visiblecontigs.add(new int[] { vstart, end - 1 });
948 int[] vcontigs = new int[visiblecontigs.size() * 2];
949 for (int i = 0, j = visiblecontigs.size(); i < j; i++)
951 int[] vc = visiblecontigs.get(i);
952 visiblecontigs.set(i, null);
953 vcontigs[i * 2] = vc[0];
954 vcontigs[i * 2 + 1] = vc[1];
956 visiblecontigs.clear();
961 return new int[] { start, end - 1 };
966 * delete any columns in alignmentAnnotation that are hidden (including
967 * sequence associated annotation).
969 * @param alignmentAnnotation
971 public void makeVisibleAnnotation(AlignmentAnnotation alignmentAnnotation)
973 makeVisibleAnnotation(-1, -1, alignmentAnnotation);
977 * delete any columns in alignmentAnnotation that are hidden (including
978 * sequence associated annotation).
981 * remove any annotation to the right of this column
983 * remove any annotation to the left of this column
984 * @param alignmentAnnotation
985 * the annotation to operate on
987 public void makeVisibleAnnotation(int start, int end,
988 AlignmentAnnotation alignmentAnnotation)
990 if (alignmentAnnotation.annotations == null)
994 if (start == end && end == -1)
997 end = alignmentAnnotation.annotations.length;
999 if (hiddenColumns != null && hiddenColumns.size() > 0)
1001 // then mangle the alignmentAnnotation annotation array
1002 Vector<Annotation[]> annels = new Vector<Annotation[]>();
1003 Annotation[] els = null;
1004 List<int[]> regions = getHiddenColumns();
1005 int blockStart = start, blockEnd = end;
1007 int hideStart, hideEnd, w = 0;
1009 for (int j = 0; j < regions.size(); j++)
1011 region = regions.get(j);
1012 hideStart = region[0];
1013 hideEnd = region[1];
1015 if (hideStart < start)
1020 blockStart = Math.min(blockStart, hideEnd + 1);
1021 blockEnd = Math.min(blockEnd, hideStart);
1023 if (blockStart > blockEnd)
1028 annels.addElement(els = new Annotation[blockEnd - blockStart]);
1029 System.arraycopy(alignmentAnnotation.annotations, blockStart, els,
1032 blockStart = hideEnd + 1;
1036 if (end > blockStart)
1038 annels.addElement(els = new Annotation[end - blockStart + 1]);
1039 if ((els.length + blockStart) <= alignmentAnnotation.annotations.length)
1041 // copy just the visible segment of the annotation row
1042 System.arraycopy(alignmentAnnotation.annotations, blockStart,
1043 els, 0, els.length);
1047 // copy to the end of the annotation row
1048 System.arraycopy(alignmentAnnotation.annotations, blockStart,
1050 (alignmentAnnotation.annotations.length - blockStart));
1059 alignmentAnnotation.annotations = new Annotation[w];
1062 for (Annotation[] chnk : annels)
1064 System.arraycopy(chnk, 0, alignmentAnnotation.annotations, w,
1071 alignmentAnnotation.restrict(start, end);
1076 * Invert the column selection from first to end-1. leaves hiddenColumns
1077 * untouched (and unselected)
1082 public void invertColumnSelection(int first, int width)
1084 boolean hasHidden = hiddenColumns != null && hiddenColumns.size() > 0;
1085 for (int i = first; i < width; i++)
1093 if (!hasHidden || isVisible(i))
1102 * add in any unselected columns from the given column selection, excluding
1103 * any that are hidden.
1107 public void addElementsFrom(ColumnSelection colsel)
1109 if (colsel != null && !colsel.isEmpty())
1111 for (Integer col : colsel.getSelected())
1113 if (hiddenColumns != null && isVisible(col.intValue()))
1115 if (!selected.contains(col))
1117 selected.addElement(col);
1125 * set the selected columns the given column selection, excluding any columns
1130 public void setElementsFrom(ColumnSelection colsel)
1132 selected = new Vector<Integer>();
1133 if (colsel.selected != null && colsel.selected.size() > 0)
1135 if (hiddenColumns != null && hiddenColumns.size() > 0)
1137 // only select visible columns in this columns selection
1138 addElementsFrom(colsel);
1142 // add everything regardless
1143 for (Integer col : colsel.getSelected())
1152 * Add gaps into the sequences aligned to profileseq under the given
1157 * - alignment to have gaps inserted into it
1159 * - alignment view where sequence corresponding to profileseq is
1161 * @return new Column selection for new alignment view, with insertions into
1162 * profileseq marked as hidden.
1164 public static ColumnSelection propagateInsertions(SequenceI profileseq,
1165 AlignmentI al, AlignmentView input)
1169 // return propagateInsertions(profileseq, al, )
1170 char gc = al.getGapCharacter();
1171 Object[] alandcolsel = input.getAlignmentAndColumnSelection(gc);
1172 ColumnSelection nview = (ColumnSelection) alandcolsel[1];
1173 SequenceI origseq = ((SequenceI[]) alandcolsel[0])[profsqpos];
1174 nview.propagateInsertions(profileseq, al, origseq);
1181 * - sequence in al which corresponds to origseq
1183 * - alignment which is to have gaps inserted into it
1185 * - sequence corresponding to profileseq which defines gap map for
1188 public void propagateInsertions(SequenceI profileseq, AlignmentI al,
1191 char gc = al.getGapCharacter();
1192 // recover mapping between sequence's non-gap positions and positions
1194 pruneDeletions(ShiftList.parseMap(origseq.gapMap()));
1195 int[] viscontigs = getVisibleContigs(0, profileseq.getLength());
1198 // input.pruneDeletions(ShiftList.parseMap(((SequenceI[])
1199 // alandcolsel[0])[0].gapMap()))
1200 // add profile to visible contigs
1201 for (int v = 0; v < viscontigs.length; v += 2)
1203 if (viscontigs[v] > spos)
1205 StringBuffer sb = new StringBuffer();
1206 for (int s = 0, ns = viscontigs[v] - spos; s < ns; s++)
1210 for (int s = 0, ns = al.getHeight(); s < ns; s++)
1212 SequenceI sqobj = al.getSequenceAt(s);
1213 if (sqobj != profileseq)
1215 String sq = al.getSequenceAt(s).getSequenceAsString();
1216 if (sq.length() <= spos + offset)
1219 int diff = spos + offset - sq.length() - 1;
1224 while ((diff = spos + offset - sq.length() - 1) > 0)
1227 // + ((diff >= sb.length()) ? sb.toString() : sb
1228 // .substring(0, diff));
1229 if (diff >= sb.length())
1231 sq += sb.toString();
1235 char[] buf = new char[diff];
1236 sb.getChars(0, diff, buf, 0);
1237 sq += buf.toString();
1241 sq += sb.toString();
1245 al.getSequenceAt(s).setSequence(
1246 sq.substring(0, spos + offset) + sb.toString()
1247 + sq.substring(spos + offset));
1251 // offset+=sb.length();
1253 spos = viscontigs[v + 1] + 1;
1255 if ((offset + spos) < profileseq.getLength())
1257 // pad the final region with gaps.
1258 StringBuffer sb = new StringBuffer();
1259 for (int s = 0, ns = profileseq.getLength() - spos - offset; s < ns; s++)
1263 for (int s = 0, ns = al.getHeight(); s < ns; s++)
1265 SequenceI sqobj = al.getSequenceAt(s);
1266 if (sqobj == profileseq)
1270 String sq = sqobj.getSequenceAsString();
1272 int diff = origseq.getLength() - sq.length();
1276 // + ((diff >= sb.length()) ? sb.toString() : sb
1277 // .substring(0, diff));
1278 if (diff >= sb.length())
1280 sq += sb.toString();
1284 char[] buf = new char[diff];
1285 sb.getChars(0, diff, buf, 0);
1286 sq += buf.toString();
1288 diff = origseq.getLength() - sq.length();
1296 * @return true if there are columns marked
1298 public boolean hasSelectedColumns()
1300 return (selected != null && selected.size() > 0);
1305 * @return true if there are columns hidden
1307 public boolean hasHiddenColumns()
1309 return hiddenColumns != null && hiddenColumns.size() > 0;
1314 * @return true if there are more than one set of columns hidden
1316 public boolean hasManyHiddenColumns()
1318 return hiddenColumns != null && hiddenColumns.size() > 1;
1322 * mark the columns corresponding to gap characters as hidden in the column
1327 public void hideInsertionsFor(SequenceI sr)
1329 List<int[]> inserts = sr.getInsertions();
1330 for (int[] r : inserts)
1332 hideColumns(r[0], r[1]);
1336 public boolean filterAnnotations(Annotation[] annotations,
1337 AnnotationFilterParameter filterParams)
1339 this.revealAllHiddenColumns();
1344 if (annotations[count] != null)
1347 boolean itemMatched = false;
1349 if (filterParams.getThresholdType() == AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD
1350 && annotations[count].value >= filterParams
1351 .getThresholdValue())
1355 if (filterParams.getThresholdType() == AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD
1356 && annotations[count].value <= filterParams
1357 .getThresholdValue())
1362 if (filterParams.isFilterAlphaHelix()
1363 && annotations[count].secondaryStructure == 'H')
1368 if (filterParams.isFilterBetaSheet()
1369 && annotations[count].secondaryStructure == 'E')
1374 if (filterParams.isFilterTurn()
1375 && annotations[count].secondaryStructure == 'S')
1380 String regexSearchString = filterParams.getRegexString();
1381 if (regexSearchString != null
1382 && !filterParams.getRegexSearchFields().isEmpty())
1384 List<SearchableAnnotationField> fields = filterParams
1385 .getRegexSearchFields();
1388 if (fields.contains(SearchableAnnotationField.DISPLAY_STRING)
1389 && annotations[count].displayCharacter
1390 .matches(regexSearchString))
1394 } catch (java.util.regex.PatternSyntaxException pse)
1396 if (annotations[count].displayCharacter
1397 .equals(regexSearchString))
1402 if (fields.contains(SearchableAnnotationField.DESCRIPTION)
1403 && annotations[count].description != null
1404 && annotations[count].description
1405 .matches(regexSearchString))
1413 this.addElement(count);
1417 } while (count < annotations.length);