Class CountRange

java.lang.Object
com.vaadin.browserless.internal.CountRange
All Implemented Interfaces:
Serializable

public final class CountRange extends Object implements Serializable
An inclusive range of component counts a lookup will accept.

For internal use only. May be renamed or removed in a future release.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final CountRange
    Accepts any number of components, which is what a lookup expects unless it is told otherwise.
    static final CountRange
    Accepts exactly one component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CountRange(int start, int endInclusive)
    Creates a range.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(int count)
    Tells whether the given count falls in this range.
    boolean
     
    static CountRange
    exactly(int count)
    Creates a range accepting exactly the given count.
    int
    Returns the highest accepted count.
    int
    Returns the lowest accepted count.
    int
     
    Formats the range as start..endInclusive, e.g.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • ANY

      public static final CountRange ANY
      Accepts any number of components, which is what a lookup expects unless it is told otherwise.
    • ONE

      public static final CountRange ONE
      Accepts exactly one component.
  • Constructor Details

    • CountRange

      public CountRange(int start, int endInclusive)
      Creates a range. An empty range, i.e. one whose end is below its start, accepts nothing.
      Parameters:
      start - the lowest accepted count
      endInclusive - the highest accepted count
  • Method Details

    • exactly

      public static CountRange exactly(int count)
      Creates a range accepting exactly the given count.
      Parameters:
      count - the only accepted count
      Returns:
      the range
    • getStart

      public int getStart()
      Returns the lowest accepted count.
      Returns:
      the start of the range
    • getEndInclusive

      public int getEndInclusive()
      Returns the highest accepted count.
      Returns:
      the end of the range, inclusive
    • contains

      public boolean contains(int count)
      Tells whether the given count falls in this range.
      Parameters:
      count - the count to check
      Returns:
      true if the count is accepted
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Formats the range as start..endInclusive, e.g. 1..5, the form lookup failure messages quote it in.
      Overrides:
      toString in class Object