1   /**
2    * Distribution License:
3    * JSword is free software; you can redistribute it and/or modify it under
4    * the terms of the GNU Lesser General Public License, version 2.1 or later
5    * as published by the Free Software Foundation. This program is distributed
6    * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
7    * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8    * See the GNU Lesser General Public License for more details.
9    *
10   * The License is available on the internet at:
11   *       http://www.gnu.org/copyleft/lgpl.html
12   * or by writing to:
13   *      Free Software Foundation, Inc.
14   *      59 Temple Place - Suite 330
15   *      Boston, MA 02111-1307, USA
16   *
17   * Copyright: 2005
18   *     The copyright to this program is held by it's authors.
19   *
20   * ID: $Id:DefaultSearchRequest.java 984 2006-01-23 14:18:33 -0500 (Mon, 23 Jan 2006) dmsmith $
21   */
22  package org.crosswire.jsword.index.search;
23  
24  /**
25   * A default implementation of a SearchRequest.
26   * 
27   * @see gnu.lgpl.License for license details.<br>
28   *      The copyright to this program is held by it's authors.
29   * @author DM Smith
30   */
31  public class DefaultSearchRequest implements SearchRequest {
32      /**
33       * Create a DefaultSearchRequest for the provided request and the provided
34       * modifiers.
35       * 
36       * @param theRequest
37       *            what is being searched
38       * @param theModifier
39       *            how the search is to be modified
40       */
41      public DefaultSearchRequest(String theRequest, SearchModifier theModifier) {
42          request = theRequest;
43          modifier = theModifier;
44      }
45  
46      /**
47       * Create a DefaultSearchRequest for the provided request.
48       * 
49       * @param theRequest
50       *            what is being searched
51       */
52      public DefaultSearchRequest(String theRequest) {
53          this(theRequest, null);
54      }
55  
56      /*
57       * (non-Javadoc)
58       * 
59       * @see org.crosswire.jsword.index.search.SearchRequest#isRanked()
60       */
61      public SearchModifier getSearchModifier() {
62          return modifier;
63      }
64  
65      /*
66       * (non-Javadoc)
67       * 
68       * @see org.crosswire.jsword.index.search.SearchRequest#getRequest()
69       */
70      public String getRequest() {
71          return request;
72      }
73  
74      /**
75       * The actual search request
76       */
77      private String request;
78  
79      /**
80       * How the search is to be modified
81       */
82      private SearchModifier modifier;
83  
84      /**
85       * Serialization ID
86       */
87      private static final long serialVersionUID = -5973134101547369187L;
88  }
89