Package com.vaadin.browserless.internal
Class CountRange
java.lang.Object
com.vaadin.browserless.internal.CountRange
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionstatic final CountRangeAccepts any number of components, which is what a lookup expects unless it is told otherwise.static final CountRangeAccepts exactly one component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(int count) Tells whether the given count falls in this range.booleanstatic CountRangeexactly(int count) Creates a range accepting exactly the given count.intReturns the highest accepted count.intgetStart()Returns the lowest accepted count.inthashCode()toString()Formats the range asstart..endInclusive, e.g.
-
Field Details
-
ANY
Accepts any number of components, which is what a lookup expects unless it is told otherwise. -
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 countendInclusive- the highest accepted count
-
-
Method Details
-
exactly
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:
trueif the count is accepted
-
equals
-
hashCode
public int hashCode() -
toString
Formats the range asstart..endInclusive, e.g.1..5, the form lookup failure messages quote it in.
-