001    /**
002     * Copyright (c) 2000-2012 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            public String getField() {
035                    return _termRangeQuery.getField();
036            }
037    
038            public String getLowerTerm() {
039                    return _termRangeQuery.getLowerTerm();
040            }
041    
042            public Object getTermRangeQuery() {
043                    return _termRangeQuery;
044            }
045    
046            public String getUpperTerm() {
047                    return _termRangeQuery.getUpperTerm();
048            }
049    
050            @Override
051            public Object getWrappedQuery() {
052                    return getTermRangeQuery();
053            }
054    
055            public boolean includesLower() {
056                    return _termRangeQuery.includesLower();
057            }
058    
059            public boolean includesUpper() {
060                    return _termRangeQuery.includesUpper();
061            }
062    
063            @Override
064            public String toString() {
065                    return _termRangeQuery.toString();
066            }
067    
068            private org.apache.lucene.search.TermRangeQuery _termRangeQuery;
069    
070    }