|
jInfer | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.mff.ksi.jinfer.base.regexp.RegexpInterval
public final class RegexpInterval
Class representing interval of each regexp. As in character regexp, which can have intervals for occurrences in form: {m, n} - at least m, at most n {m, } - at least m to infinity {, n} - zero to at most n Every regexp has an interval. Every interval has minimum as a natural number. Maximum can be unbounded and for this case, calling 'isUnbounded' will reveal. Calling getMax when interval is unbounded causes exception. There are some helper functions for common cases (*;+;?;{m,};{1,1})
Method Summary | |
---|---|
static RegexpInterval |
getBounded(int min,
int max)
Get a bounded interval, specify min, max integers |
RegexpInterval |
getCopy()
Clone existing interval\ |
static RegexpInterval |
getKleeneCross()
Get KleeneCross, that is + quantification, min= 1, max is unbounded |
static RegexpInterval |
getKleeneStar()
Get KleeneStar *, asterisk. |
int |
getMax()
Get the maximum value, throws exception on unbounded interval (ask using isUnbounded() before calling getMax(). |
int |
getMin()
Get minimum value |
static RegexpInterval |
getOnce()
Get interval with exactly once meaning, that is min=max=1 |
static RegexpInterval |
getOptional()
Get ? quantification, that is zero or once. |
static RegexpInterval |
getUnbounded(int min)
Get right unbounded interval, specify only minimum, maximum is considered unbounded |
static RegexpInterval |
intersectIntervals(RegexpInterval first,
RegexpInterval second)
Create an interval that is within both intervals provided as arguments. |
boolean |
isKleeneCross()
Whether interval is + |
boolean |
isKleeneStar()
Whether interval is * |
boolean |
isOnce()
Whether interval is bounded {1,1}. |
boolean |
isOptional()
Whether interval is ? |
boolean |
isUnbounded()
Whether interval is unbouded. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public RegexpInterval getCopy()
public static RegexpInterval getBounded(int min, int max)
min
- interval minmax
- interval max
public static RegexpInterval getUnbounded(int min)
min
- interval min
public static RegexpInterval getOnce()
public static RegexpInterval getOptional()
public static RegexpInterval getKleeneStar()
public static RegexpInterval getKleeneCross()
public boolean isUnbounded()
public boolean isOnce()
public boolean isOptional()
public boolean isKleeneStar()
public boolean isKleeneCross()
public int getMax()
isUnbounded()
before calling getMax().
public int getMin()
public static RegexpInterval intersectIntervals(RegexpInterval first, RegexpInterval second) throws IllegalArgumentException
first
- First of the intervals.second
- Second of the intervals.
IllegalArgumentException
- When either of the arguments is null, or intervals have no intersection.public String toString()
toString
in class Object
|
jInfer | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |