public class CalendarRange extends Object implements ValuePredicate<Calendar>
Constructor and Description |
---|
CalendarRange(int lowerBound,
int upperBound,
int scale)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(Calendar expected,
Calendar actual)
Returns
true iff both values satisfy this predicate. |
String |
describeExpected(Calendar expected,
Calendar actual)
Returns an expected value as readable text.
|
public CalendarRange(int lowerBound, int upperBound, int scale)
lowerBound
- lower bound offset from expected value in the specified scaleupperBound
- upper bound offset from expected value in the specified scalescale
- the calendar field of offset scale (ex. Calendar.DATE, or Calendar.SECOND)public boolean accepts(Calendar expected, Calendar actual)
ValuePredicate
true
iff both values satisfy this predicate.accepts
in interface ValuePredicate<Calendar>
expected
- the expected value (nullable)actual
- the actual value (nullable)true
iff both values satisfy this predicate, false
otherwise.public String describeExpected(Calendar expected, Calendar actual)
ValuePredicate
describeExpected
in interface ValuePredicate<Calendar>
expected
- the expected value (nullable)actual
- the actual value (nullable)null
if is always/never expectedCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.