|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.webmancer.util.integerset.IntervalIntegerSetParser
public class IntervalIntegerSetParser
This class parses string of a list of non-negative integers and creates a IIntegerSet
from it. The recognized
format is a list of non-negative integers delimited by colon (","), also intervals could be used. The delimiter of
interval values is minus sign ("-"). Whitespaces are skipped.
Example: "-2,3,6-10,13,20-"
results in a IIntegerSet
that contains all numbers from
minimum
to 2 (inclusive), then also values 3, 6, 7, 8, 9, 10, 13 and all numbers from 20 (inclusive) to
maximum
.
Constructor Summary | |
---|---|
IntervalIntegerSetParser()
Create new parser using boundaries from 0 to Integer.MAX_VALUE . |
|
IntervalIntegerSetParser(int minimum,
int maximum)
Create new parser using given boundaries. |
Method Summary | |
---|---|
IIntegerSet |
parse(java.lang.String str)
Parse the given string to integer set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IntervalIntegerSetParser(int minimum, int maximum)
minimum
must be lower or equal to
maximum
.
minimum
- The minimum value (lower boundary for open intervals). The value must be non-negative since this
parser does not support negative integers.maximum
- The maximum value (upper boundary for open intervals). A value of Integer.MAX_VALUE
means
"infinity".public IntervalIntegerSetParser()
Integer.MAX_VALUE
.
IntervalIntegerSetParser(int, int)
Method Detail |
---|
public IIntegerSet parse(java.lang.String str) throws java.lang.NumberFormatException
parse
in interface IIntegerSetParser
str
- A string to be parsed
str
java.lang.NumberFormatException
- if any non-integer number is foundcz.vsb.cs.ruleminer.util.integerset.IIntegerSetParser#parse(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |