001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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    }