Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.apache.maven.archiva.indexer.query;
  
  /*
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you under the Apache License, Version 2.0 (the
   * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
  *
  *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */

Query object that handles range queries (presently used for dates).

Author(s):
Maria Odea Ching
Brett Porter
 
 public class RangeQuery
     implements Query
 {
    
Whether values equal to the boundaries are included in the query results.
 
     private final boolean inclusive;

    
The lower bound.
 
     private final QueryTerm begin;

    
The upper bound.
 
     private final QueryTerm end;

    
Constructor.

Parameters:
begin the lower bound
end the upper bound
inclusive whether to include the boundaries in the query
 
     private RangeQueryQueryTerm beginQueryTerm endboolean inclusive )
     {
         this. = begin;
         this. = end;
         this. = inclusive;
     }

    
Create an open range, including all results.

Returns:
the query object
 
     public static RangeQuery createOpenRange()
     {
         return new RangeQuerynullnullfalse );
     }

    
Create a bounded range, excluding the endpoints.

Parameters:
begin the lower bound value to compare to
end the upper bound value to compare to
Returns:
the query object
 
     public static RangeQuery createExclusiveRangeQueryTerm beginQueryTerm end )
     {
         return new RangeQuerybeginendfalse );
     }

    
Create a bounded range, including the endpoints.

Parameters:
begin the lower bound value to compare to
end the upper bound value to compare to
Returns:
the query object
 
     public static RangeQuery createInclusiveRangeQueryTerm beginQueryTerm end )
     {
         return new RangeQuerybeginendtrue );
     }

    
Create a range that is greater than or equal to a given term.

Parameters:
begin the value to compare to
Returns:
the query object
 
    public static RangeQuery createGreaterThanOrEqualToRangeQueryTerm begin )
    {
        return new RangeQuerybeginnulltrue );
    }

    
Create a range that is greater than a given term.

Parameters:
begin the value to compare to
Returns:
the query object
    public static RangeQuery createGreaterThanRangeQueryTerm begin )
    {
        return new RangeQuerybeginnullfalse );
    }

    
Create a range that is less than or equal to a given term.

Parameters:
end the value to compare to
Returns:
the query object
    public static RangeQuery createLessThanOrEqualToRangeQueryTerm end )
    {
        return new RangeQuerynullendtrue );
    }

    
Create a range that is less than a given term.

Parameters:
end the value to compare to
Returns:
the query object
    public static RangeQuery createLessThanRangeQueryTerm end )
    {
        return new RangeQuerynullendfalse );
    }
    public QueryTerm getBegin()
    {
        return ;
    }
    public QueryTerm getEnd()
    {
        return ;
    }
    public boolean isInclusive()
    {
        return ;
    }
New to GrepCode? Check out our FAQ X