KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jdesktop > swing > Searchable


1 /*
2  * $Id: Searchable.java,v 1.1.1.1 2004/06/16 01:43:39 davidson1 Exp $
3  *
4  * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5  * Santa Clara, California 95054, U.S.A. All rights reserved.
6  */

7
8 package org.jdesktop.swing;
9
10 import java.util.regex.Pattern JavaDoc;
11
12 /**
13  * Searchable
14  *
15  * @author Ramesh Gupta
16  */

17 public interface Searchable {
18
19     /**
20      * Search from the beginning of a document
21      */

22     public int search(String JavaDoc searchString);
23     public int search(String JavaDoc searchString, int startIndex);
24     public int search(Pattern JavaDoc pattern);
25
26     /**
27      * Search for the pattern from the start index.
28      * @param pattern Pattern for search
29      * @param startIndex starting index of search. If -1 then start from the beginning
30      * @return index of matched pattern. -1 if a match cannot be found.
31      */

32     public int search(Pattern JavaDoc pattern, int startIndex);
33
34     /**
35      * Search for the pattern from the start index.
36      * @param pattern Pattern for search
37      * @param startIndex starting index of search. If -1 then start from the beginning
38      * @param backward indicates the direction if true then search is backwards
39      * @return index of matched pattern. -1 if a match cannot be found.
40      */

41     public int search(Pattern JavaDoc pattern, int startIndex, boolean backward);
42 }
43
Popular Tags