LSInterval Class¶
- class LSInterval¶
Value type for interval expressions. Such a value is obtained with
LSExpression.value
or withLSSolution.getValue()
.- See:
- See:
Summary¶
Returns true if the interval is void. |
|
Returns true if the interval is degenerate. |
|
Returns the start of the interval. |
|
Returns the end of the interval. |
|
Returns the number of elements in the interval. |
|
Returns true if the interval contains the given value, false otherwise. |
|
Returns a string representation of the interval. |
Methods¶
- LSInterval.isVoid(val)¶
Returns true if the interval is void. A void interval is an empty interval with no valid start or end bounds.
- Returns:
True if the interval is void.
- Return type:
bool
- LSInterval.isDegenerate()¶
Returns true if the interval is degenerate. A degenerate interval is an interval with equal start and end bounds. It does not contain any element.
- Returns:
True if the interval is degenerate.
- Return type:
bool
- LSInterval.getStart()¶
Returns the start of the interval. Cannot be called on a void interval as it does not have a valid start.
- Returns:
Start of the interval.
- Return type:
int
- LSInterval.getEnd(value)¶
Returns the end of the interval. Cannot be called on a void interval as it does not have a valid end.
- Returns:
End of the interval.
- Return type:
int
- LSInterval.count(value)¶
Returns the number of elements in the interval. A void or degenerate interval does not contain any element.
- Returns:
Number of elements in the interval.
- Return type:
int
- LSInterval.contains(value)¶
Returns true if the interval contains the given value, false otherwise.
- Parameters:
value – element whose presence in this interval is to be tested.
- Returns:
True if the interval contains the value.
- Return type:
bool
- LSInterval.toString(value)¶
Returns a string representation of the interval.
- Returns:
String representation.
- Return type:
string