public abstract class Region<T extends Comparable<T>> extends Object
全封闭的区间 : [T0, T1] 左开右闭区间 : (T0, T1] 左闭右开区间 : [T0, T1) 左开右闭区间 : (T0, T1] 全开放的区间 : (T0, T1) 精确等于某值 : (T0) 或 [T0) # 总之开闭区间无所谓了比如对于数字:
[4,10] // >=4 && <=10 (6,54] // >=6 && <54 (,78) // <78对于日期
[2012-09-10 12:33:24, 2013-08-14] // 会自动交换大小值,可以是日期或者时间
限定符和类型 | 字段和说明 |
---|---|
protected Class<T> |
eleType |
protected T |
left |
protected boolean |
leftOpen |
protected T |
right |
protected boolean |
rightOpen |
构造器和说明 |
---|
Region() |
限定符和类型 | 方法和说明 |
---|---|
static DateRegion |
Date(String str) |
static DateRegion |
Datef(String fmt,
Object... args) |
static DoubleRegion |
Double(String str) |
static DoubleRegion |
Doublef(String fmt,
Object... args) |
static FloatRegion |
Float(String str) |
static FloatRegion |
Floatf(String fmt,
Object... args) |
T |
fromString(String str) |
static IntRegion |
Int(String str) |
static IntRegion |
Intf(String fmt,
Object... args) |
boolean |
isLeftOpen() |
boolean |
isNull() |
boolean |
isRegion() |
boolean |
isRightOpen() |
T |
left() |
Region<T> |
left(T left) |
Region<T> |
leftOpen(boolean open) |
String |
leftOpt(String gt,
String gte)
根据左边开闭区间的情况返回一个正确的左边比较的运算符
|
static LongRegion |
Long(String str) |
static LongRegion |
Longf(String fmt,
Object... args) |
boolean |
match(T obj) |
T |
right() |
Region<T> |
right(T right) |
Region<T> |
rightOpen(boolean open) |
String |
rightOpt(String lt,
String lte)
根据右边开闭区间的情况返回一个正确的右边比较的运算符
|
String |
toString() |
String |
toString(T obj) |
Region<T> |
valueOf(String str)
解析
|
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 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.