[jsword-svn] jsword/java/jsword/org/crosswire/jsword/book/search/basic s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Fri Apr 1 10:09:49 MST 2005


Update of /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/basic
In directory www.crosswire.org:/tmp/cvs-serv5088/java/jsword/org/crosswire/jsword/book/search/basic

Added Files:
	DefaultSearchRequest.java DefaultSearchModifier.java 
	package.html AbstractIndex.java 
Log Message:
Improved ranking, bible display and fixed a few bugs.

--- NEW FILE: DefaultSearchModifier.java ---
package org.crosswire.jsword.book.search.basic;

import org.crosswire.jsword.book.search.SearchModifier;

/**
 * The DefaultSearchModifier provides a simple implementation
 * of a SearchModifier.
 * 
 * <p><table border='1' cellPadding='3' cellSpacing='0'>
 * <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
 *
 * Distribution Licence:<br />
 * JSword is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General Public License,
 * version 2 as published by the Free Software Foundation.<br />
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.<br />
 * The License is available on the internet
 * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, or by writing to:
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 * MA 02111-1307, USA<br />
 * The copyright to this program is held by it's authors.
 * </font></td></tr></table>
 * @see gnu.gpl.Licence
 * @author DM Smith [dmsmith555 at gmail dot com]
 * @version $Id: DefaultSearchModifier.java,v 1.1 2005/04/01 17:09:46 dmsmith Exp $
 */

public class DefaultSearchModifier implements SearchModifier
{

    /* (non-Javadoc)
     * @see org.crosswire.jsword.book.search.SearchModifier#isRanked()
     */
    public boolean isRanked()
    {
        return ranked;
    }

    /**
     * Set whether or not the search should be ranked.
     * @param newRanked true if the search should be ranked
     */
    public void setRanked(boolean newRanked)
    {
        ranked = newRanked;
    }

    /**
     * The indicator of whether the request should be ranked.
     */
    private boolean ranked;
}

--- NEW FILE: package.html ---
<html>
<body>

<p>
  Initial implementations of the search interfaces.
</p>

</body>
</html>

--- NEW FILE: AbstractIndex.java ---
package org.crosswire.jsword.book.search.basic;

import org.crosswire.jsword.book.search.Index;
import org.crosswire.jsword.book.search.SearchModifier;

/**
 * A simple implementation of an Index that provides the
 * set/get for SearchModifier.
 * 
 * <p><table border='1' cellPadding='3' cellSpacing='0'>
 * <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
 *
 * Distribution Licence:<br />
 * JSword is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General Public License,
 * version 2 as published by the Free Software Foundation.<br />
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.<br />
 * The License is available on the internet
 * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, or by writing to:
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 * MA 02111-1307, USA<br />
 * The copyright to this program is held by it's authors.
 * </font></td></tr></table>
 * @see gnu.gpl.Licence
 * @author DM Smith [dmsmith555 at gmail dot com]
 * @version $Id: AbstractIndex.java,v 1.1 2005/04/01 17:09:46 dmsmith Exp $
 */

public abstract class AbstractIndex implements Index
{

    /* (non-Javadoc)
     * @see org.crosswire.jsword.book.search.Index#setSearchModifier(org.crosswire.jsword.book.search.SearchModifier)
     */
    public void setSearchModifier(SearchModifier theModifier)
    {
        modifier = theModifier;
    }

    /* (non-Javadoc)
     * @see org.crosswire.jsword.book.search.Index#getSearchModifier()
     */
    public SearchModifier getSearchModifier()
    {
        return modifier;
    }

    /**
     * How the search is to be modified.
     */
    private SearchModifier modifier;
}

--- NEW FILE: DefaultSearchRequest.java ---
package org.crosswire.jsword.book.search.basic;

import org.crosswire.jsword.book.search.SearchModifier;
import org.crosswire.jsword.book.search.SearchRequest;

/**
 * A default implementation of a SearchRequest
 * 
 * <p><table border='1' cellPadding='3' cellSpacing='0'>
 * <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
 *
 * Distribution Licence:<br />
 * JSword is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General Public License,
 * version 2 as published by the Free Software Foundation.<br />
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.<br />
 * The License is available on the internet
 * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, or by writing to:
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 * MA 02111-1307, USA<br />
 * The copyright to this program is held by it's authors.
 * </font></td></tr></table>
 * @see gnu.gpl.Licence
 * @author DM Smith [dmsmith555 at gmail dot com]
 * @version $Id: DefaultSearchRequest.java,v 1.1 2005/04/01 17:09:46 dmsmith Exp $
 */
public class DefaultSearchRequest implements SearchRequest
{

    /**
     * Create a DefaultSearchRequest for the provided request and
     * the provided modifiers.
     * @param theRequest what is being searched
     * @param theModifier how the search is to be modified
     */
    public DefaultSearchRequest(String theRequest, SearchModifier theModifier)
    {
        request = theRequest;
        modifier = theModifier;
    }

    /**
     * Create a DefaultSearchRequest for the provided request.
     * @param theRequest what is being searched
     */
    public DefaultSearchRequest(String theRequest)
    {
        this(theRequest, null);
    }

    /* (non-Javadoc)
     * @see org.crosswire.jsword.book.search.SearchRequest#isRanked()
     */
    public SearchModifier getSearchModifier()
    {
        return modifier;
    }

    /* (non-Javadoc)
     * @see org.crosswire.jsword.book.search.SearchRequest#getRequest()
     */
    public String getRequest()
    {
        return request;
    }

    /**
     * The actual search request
     */
    private String request;

    /**
     * How the search is to be modified
     */
    private SearchModifier modifier;
}



More information about the jsword-svn mailing list