DefaultSearchRequest.java |
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 * © CrossWire Bible Society, 2005 - 2016 18 */ 19 package org.crosswire.jsword.index.search; 20 21 /** 22 * A default implementation of a SearchRequest. 23 * 24 * @see gnu.lgpl.License The GNU Lesser General Public License for details. 25 * @author DM Smith 26 */ 27 public class DefaultSearchRequest implements SearchRequest { 28 /** 29 * Create a DefaultSearchRequest for the provided request and the provided 30 * modifiers. 31 * 32 * @param theRequest 33 * what is being searched 34 * @param theModifier 35 * how the search is to be modified 36 */ 37 public DefaultSearchRequest(String theRequest, SearchModifier theModifier) { 38 request = theRequest; 39 modifier = theModifier; 40 } 41 42 /** 43 * Create a DefaultSearchRequest for the provided request. 44 * 45 * @param theRequest 46 * what is being searched 47 */ 48 public DefaultSearchRequest(String theRequest) { 49 this(theRequest, null); 50 } 51 52 /* 53 * (non-Javadoc) 54 * 55 * @see org.crosswire.jsword.index.search.SearchRequest#isRanked() 56 */ 57 public SearchModifier getSearchModifier() { 58 return modifier; 59 } 60 61 /* 62 * (non-Javadoc) 63 * 64 * @see org.crosswire.jsword.index.search.SearchRequest#getRequest() 65 */ 66 public String getRequest() { 67 return request; 68 } 69 70 /** 71 * The actual search request 72 */ 73 private String request; 74 75 /** 76 * How the search is to be modified 77 */ 78 private SearchModifier modifier; 79 80 /** 81 * Serialization ID 82 */ 83 private static final long serialVersionUID = -5973134101547369187L; 84 } 85