1 package com.loribel.commons.abstraction; 2 3 import java.util.*; 4 5 /*** 6 * Abstraction of a date interval. 7 */ 8 public interface GB_DateSelector 9 extends 10 GB_Selector 11 { 12 /*** 13 * Available types to use with this interval. 14 */ 15 public static final class TYPE 16 { 17 public static final int NOT_NULL = -2; 18 public static final int NULL = -1; 19 public static final int NONE = 0; 20 public static final int EQUALS = 1; 21 public static final int SUPERIOR = 2; 22 public static final int SUPERIOR_STRICT = 3; 23 public static final int INFERIOR = 4; 24 public static final int INFERIOR_STRICT = 5; 25 public static final int INTERVAL = 6; 26 public static final int INTERVAL_STRICT = 7; 27 public static final int INTERVAL_STRICT_EQUAL = 8; 28 public static final int INTERVAL_EQUAL_STRICT = 9; 29 30 public static final int TODAY = 10; 31 public static final int BEFORE_DAYS = 11; 32 public static final int BEFORE_WEEKS = 12; 33 public static final int BEFORE_MONTHS = 13; 34 public static final int BEFORE_YEARS = 14; 35 36 public static final int AFTER_DAYS = 15; 37 public static final int AFTER_WEEKS = 16; 38 public static final int AFTER_MONTHS = 17; 39 public static final int AFTER_YEARS = 18; 40 41 public static final int BEFORE_MORE_DAYS = 19; 42 public static final int BEFORE_MORE_WEEKS = 20; 43 public static final int BEFORE_MORE_MONTHS = 21; 44 public static final int BEFORE_MORE_YEARS = 22; 45 46 public static final int AFTER_MORE_DAYS = 23; 47 public static final int AFTER_MORE_WEEKS = 24; 48 public static final int AFTER_MORE_MONTHS = 25; 49 public static final int AFTER_MORE_YEARS = 26; 50 } 51 52 /*** 53 * Returns the min value of the interval or the value used as constraint. 54 */ 55 Date getValue(); 56 57 /*** 58 * Returns the max value of interval if needed, otherwise returns null. 59 */ 60 Date getValue2(); 61 62 /*** 63 * Returns the number of days, months, years 64 */ 65 int getCount(); 66 67 }