Package org.openl.rules.range
Class Range<T>
- java.lang.Object
-
- org.openl.rules.range.Range<T>
-
- Type Parameters:
T- type of range
- Direct Known Subclasses:
CharRange,DateRange,DoubleRange,IntRange,StringRange
public abstract class Range<T> extends Object
Base class of ranges with utility methods.- Author:
- Yury Molchan
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRange.Boundstatic classRange.Type
-
Constructor Summary
Constructors Constructor Description Range()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract intcompare(T left, T right)booleancontains(Range<T> range)protected booleancontains(T value)WARNING: Due limitation of OpenL which cannot work correctly with class level generics, so it is declared as protected.booleanequals(Object obj)protected voidformat(StringBuilder sb, T value)protected abstract TgetLeft()protected abstract TgetRight()protected abstract Range.TypegetType()inthashCode()protected RangeParserparse(String text)StringtoString()protected voidvalidate()
-
-
-
Method Detail
-
parse
protected RangeParser parse(String text)
-
validate
protected void validate()
-
getType
protected abstract Range.Type getType()
-
getLeft
protected abstract T getLeft()
-
getRight
protected abstract T getRight()
-
format
protected void format(StringBuilder sb, T value)
-
contains
protected boolean contains(T value)
WARNING: Due limitation of OpenL which cannot work correctly with class level generics, so it is declared as protected. It needs to define public method in children classes with type of generic parameter. OpenL can correctly select required method or show an error.- Parameters:
value- value to check it is in the range (interval)- Returns:
- true if the value is in the interval
-
-