edu.northwestern.at.monk.model
Class NumericCriterion

java.lang.Object
  extended by edu.northwestern.at.monk.model.SearchCriterion
      extended by edu.northwestern.at.monk.model.NumericCriterion
Direct Known Subclasses:
DoubleCriterion, LongCriterion

public abstract class NumericCriterion
extends SearchCriterion

A numeric search criterion.

A numeric search criterion matches a numeric attribute of some object, expressed in terms of one or more (start,end) ranges. An attribute value x matches such a range iff start <= x <= end. Either or both of start and end may be null, in which case there is no restriction.

Thus, a numeric criterion can be used to express "between", "less than or equal", "greater than or equal" and "exactly equal" conditions, as summarized in the following table:

start end condition
not null not null start ≤ x ≤ end
null not null x ≤ end
not null null x ≥ start
not null = start x = start = end
null null no conditions
(everything matches)

For example:

criterion matches
new AuthorBirthDate(1840, 1870) any author birth date between 1840 and 1870 inclusive
new AuthorBirthDate(null, 1870) any author birth date less than or equal to 1870
new AuthorBirthDate(1840, null) any author birth date greater than or equal to 1840
new AuthorBirthDate(1850, 1850) an author birth date exactly equal to 1850
new AuthorBirthDate(null, null) any author birth date, with no restriction

See Also:
MONK Datastore Overview, Licensing Agreement

Method Summary
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait