001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.search.lucene;
016    
017    import com.liferay.portal.kernel.search.BaseQueryImpl;
018    import com.liferay.portal.kernel.search.TermRangeQuery;
019    
020    /**
021     * @author Raymond Aug??
022     */
023    public class TermRangeQueryImpl extends BaseQueryImpl
024            implements TermRangeQuery {
025    
026            public TermRangeQueryImpl(
027                    String field, String lowerTerm, String upperTerm, boolean includesLower,
028                    boolean includesUpper) {
029    
030                    _termRangeQuery = new org.apache.lucene.search.TermRangeQuery(
031                            field, lowerTerm, upperTerm, includesLower, includesUpper);
032            }
033    
034            @Override
035            public String getField() {
036                    return _termRangeQuery.getField();
037            }
038    
039            @Override
040            public String getLowerTerm() {
041                    return _termRangeQuery.getLowerTerm();
042            }
043    
044            public Object getTermRangeQuery() {
045                    return _termRangeQuery;
046            }
047    
048            @Override
049            public String getUpperTerm() {
050                    return _termRangeQuery.getUpperTerm();
051            }
052    
053            @Override
054            public Object getWrappedQuery() {
055                    return getTermRangeQuery();
056            }
057    
058            @Override
059            public boolean includesLower() {
060                    return _termRangeQuery.includesLower();
061            }
062    
063            @Override
064            public boolean includesUpper() {
065                    return _termRangeQuery.includesUpper();
066            }
067    
068            @Override
069            public String toString() {
070                    return _termRangeQuery.toString();
071            }
072    
073            private org.apache.lucene.search.TermRangeQuery _termRangeQuery;
074    
075    }