public abstract class Region<T extends Comparable<T>> extends Object
全封闭的区间 : [T0, T1] 左开右闭区间 : (T0, T1] 左闭右开区间 : [T0, T1) 左开右闭区间 : (T0, T1] 全开放的区间 : (T0, T1) 精确等于某值 : (T0] 或 [T0) 或 [T0] 精确不等于某值 : (T0)比如对于数字:
[4,10] // >=4 && <=10 (6,54] // >=6 && <54 (,78) // <78 [50] // == 50 (99) // !=99对于日期
[2012-09-10 12:33:24, 2013-08-14] // 会自动交换大小值,可以是日期或者时间
Modifier and Type | Field and Description |
---|---|
protected Class<T> |
eleType |
protected T |
left |
protected boolean |
leftOpen |
protected T |
right |
protected boolean |
rightOpen |
Constructor and Description |
---|
Region() |
protected Class<T extends Comparable<T>> eleType
protected T extends Comparable<T> left
protected T extends Comparable<T> right
protected boolean leftOpen
protected boolean rightOpen
public static LongRegion Long(String str)
public static LongRegion Longf(String fmt, Object... args)
public static FloatRegion Float(String str)
public static FloatRegion Floatf(String fmt, Object... args)
public static DoubleRegion Double(String str)
public static DoubleRegion Doublef(String fmt, Object... args)
public static DateRegion Date(String str)
public static DateRegion Datef(String fmt, Object... args)
public static TimeRegion Time(String str)
public static TimeRegion Timef(String fmt, Object... args)
public T left()
public T right()
public boolean isLeftOpen()
public boolean isRightOpen()
public boolean isRegion()
public boolean isNull()
public String leftOpt(String gt, String gte)
gt
- 大于的运算符,开区间时采用gte
- 大于等于的运算符,闭区间时采用public String rightOpt(String lt, String lte)
lt
- 小于的运算符,开区间时采用lte
- 小于等于的运算符,闭区间时采用public boolean match(T obj)
obj
- 对象Copyright © 2017. All rights reserved.