Package org.openl.rules.helpers
Class StringRange
- java.lang.Object
-
- org.openl.rules.range.Range<CharSequence>
-
- org.openl.rules.helpers.StringRange
-
public class StringRange extends Range<CharSequence>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openl.rules.range.Range
Range.Bound, Range.Type
-
-
Constructor Summary
Constructors Constructor Description StringRange(String source)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringRangeautocast(String x, StringRange y)static StringRangecast(char[] x, StringRange y)protected intcompare(CharSequence left, CharSequence right)booleancontains(CharSequence value)WARNING: Due limitation of OpenL which cannot work correctly with class level generics, so it is declared as protected.static intdistance(char[] x, StringRange y)static intdistance(String x, StringRange y)protected CharSequencegetLeft()NumericComparableStringgetLowerBound()ARangeParser.ParseStruct.BoundTypegetLowerBoundType()protected CharSequencegetRight()Range.TypegetType()NumericComparableStringgetUpperBound()ARangeParser.ParseStruct.BoundTypegetUpperBoundType()
-
-
-
Constructor Detail
-
StringRange
public StringRange(String source)
-
-
Method Detail
-
getLowerBound
public NumericComparableString getLowerBound()
-
getLowerBoundType
public ARangeParser.ParseStruct.BoundType getLowerBoundType()
-
getUpperBound
public NumericComparableString getUpperBound()
-
getUpperBoundType
public ARangeParser.ParseStruct.BoundType getUpperBoundType()
-
contains
public boolean contains(CharSequence value)
Description copied from class:RangeWARNING: 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.- Overrides:
containsin classRange<CharSequence>- Parameters:
value- value to check it is in the range (interval)- Returns:
- true if the value is in the interval
-
getType
public Range.Type getType()
- Specified by:
getTypein classRange<CharSequence>
-
getLeft
protected CharSequence getLeft()
- Specified by:
getLeftin classRange<CharSequence>
-
getRight
protected CharSequence getRight()
- Specified by:
getRightin classRange<CharSequence>
-
compare
protected int compare(CharSequence left, CharSequence right)
- Specified by:
comparein classRange<CharSequence>
-
autocast
public static StringRange autocast(String x, StringRange y)
-
distance
public static int distance(String x, StringRange y)
-
cast
public static StringRange cast(char[] x, StringRange y)
-
distance
public static int distance(char[] x, StringRange y)
-
-