Class FacetRange

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class FacetRange
    extends java.lang.Object
    implements java.lang.Cloneable, java.io.Serializable
    Defines a range of values to generate a FacetBucket for.

    NOTE: the lower bounds of the range is inclusive, while the upper bounds is exclusive.

    NOTE: A range bucket's primary sort value is the upper bounds of the range. The secondary sort value is the range's lower bounds.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      FacetRange()  
      FacetRange​(java.lang.Number minValue, java.lang.Number maxValue)
      Construct a new FacetRange.
      FacetRange​(java.lang.String label)  
      FacetRange​(java.lang.String label, java.lang.Number minValue, java.lang.Number maxValue)
      Construct a new FacetRange.
      FacetRange​(java.lang.String label, java.util.Date minValue, java.util.Date maxValue)
      Construct a new FacetRange.
      FacetRange​(java.util.Date minValue, java.util.Date maxValue)
      Construct a new FacetRange.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FacetRange clone()  
      protected static java.lang.Number coerce​(java.lang.Number value)
      Coerce numbers to have consistent type.
      boolean equals​(java.lang.Object other)
      java.lang.String getLabel()
      Get the optional label for this range.
      protected java.lang.Long getMaxDate()  
      protected java.lang.Number getMaxNumber()
      JSON SUPPORT FOLLOWS
      java.lang.Object getMaxValue()
      Get the maximum value for this range (or null if unbounded) [exclusive].
      protected java.lang.Long getMinDate()  
      protected java.lang.Number getMinNumber()  
      java.lang.Object getMinValue()
      Get the minimum value for this range (or null if unbounded) [inclusive].
      int hashCode()
      void setLabel​(java.lang.String value)
      Set the optional label for this range.
      protected void setMaxDate​(java.lang.Long value)  
      protected void setMaxNumber​(java.lang.String value)  
      void setMaxValue​(java.lang.Number value)
      Set the maximum value for this range (or null if unbounded) [inclusive].
      void setMaxValue​(java.util.Date value)
      Set the maximum value for this range (or null if unbounded) [inclusive].
      protected void setMinDate​(java.lang.Long value)  
      protected void setMinNumber​(java.lang.String value)  
      void setMinValue​(java.lang.Number value)
      Set the minimum value for this range (or null if unbounded) [inclusive].
      void setMinValue​(java.util.Date value)
      Set the minimum value for this range (or null if unbounded) [inclusive].
      protected static java.util.Date toDate​(java.lang.Long value)  
      protected static java.lang.Long toDate​(java.lang.Object value)  
      protected static java.math.BigDecimal toDecimal​(java.lang.String value)  
      protected static java.lang.Number toNumber​(java.lang.Object value)  
      PhraseTerm toPhrase()
      Get a Phrase suitable for matching this range.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • EMPTY_ARRAY

        public static final FacetRange[] EMPTY_ARRAY
    • Constructor Detail

      • FacetRange

        public FacetRange()
      • FacetRange

        public FacetRange​(java.lang.String label)
      • FacetRange

        public FacetRange​(java.lang.Number minValue,
                          java.lang.Number maxValue)
        Construct a new FacetRange.
      • FacetRange

        public FacetRange​(java.util.Date minValue,
                          java.util.Date maxValue)
        Construct a new FacetRange.
      • FacetRange

        public FacetRange​(java.lang.String label,
                          java.lang.Number minValue,
                          java.lang.Number maxValue)
        Construct a new FacetRange.
      • FacetRange

        public FacetRange​(java.lang.String label,
                          java.util.Date minValue,
                          java.util.Date maxValue)
        Construct a new FacetRange.
    • Method Detail

      • getLabel

        public java.lang.String getLabel()
        Get the optional label for this range.
      • setLabel

        public void setLabel​(java.lang.String value)
        Set the optional label for this range.
      • getMinValue

        public java.lang.Object getMinValue()
        Get the minimum value for this range (or null if unbounded) [inclusive].
      • setMinValue

        public void setMinValue​(java.lang.Number value)
        Set the minimum value for this range (or null if unbounded) [inclusive].
      • setMinValue

        public void setMinValue​(java.util.Date value)
        Set the minimum value for this range (or null if unbounded) [inclusive].
      • getMaxValue

        public java.lang.Object getMaxValue()
        Get the maximum value for this range (or null if unbounded) [exclusive].
      • setMaxValue

        public void setMaxValue​(java.lang.Number value)
        Set the maximum value for this range (or null if unbounded) [inclusive].
      • setMaxValue

        public void setMaxValue​(java.util.Date value)
        Set the maximum value for this range (or null if unbounded) [inclusive].
      • toPhrase

        public PhraseTerm toPhrase()
        Get a Phrase suitable for matching this range.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • clone

        public FacetRange clone()
        Overrides:
        clone in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • coerce

        protected static java.lang.Number coerce​(java.lang.Number value)
        Coerce numbers to have consistent type.
      • getMaxNumber

        protected java.lang.Number getMaxNumber()
        JSON SUPPORT FOLLOWS
      • getMinNumber

        protected java.lang.Number getMinNumber()
      • setMinNumber

        protected void setMinNumber​(java.lang.String value)
      • setMaxNumber

        protected void setMaxNumber​(java.lang.String value)
      • getMinDate

        protected java.lang.Long getMinDate()
      • getMaxDate

        protected java.lang.Long getMaxDate()
      • setMinDate

        protected void setMinDate​(java.lang.Long value)
      • setMaxDate

        protected void setMaxDate​(java.lang.Long value)
      • toDecimal

        protected static java.math.BigDecimal toDecimal​(java.lang.String value)
      • toNumber

        protected static java.lang.Number toNumber​(java.lang.Object value)
      • toDate

        protected static java.lang.Long toDate​(java.lang.Object value)
      • toDate

        protected static java.util.Date toDate​(java.lang.Long value)