public class Range extends Value
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EQ_ERROR_MESSAGE |
static java.lang.String |
RANGE_SET_ERROR_MESSAGE |
| Constructor and Description |
|---|
Range()
Default constructor.
|
Range(Range other)
Copy constructor.
|
Range(SimpleNumeric from,
boolean includeFrom,
SimpleNumeric to,
boolean includeTo) |
Range(SimpleNumeric from,
boolean includeFrom,
SimpleNumeric to,
boolean includeTo,
float certaintyFactor) |
Range(SimpleNumeric from,
SimpleNumeric to)
Range constructor that sets the range boundaries according to given parameters.
|
Range(SimpleNumeric from,
SimpleNumeric to,
float certaintyFactor)
Range constructor that sets the range boundaries according to given parameters.
|
Range(SimpleSymbolic from,
boolean includeFrom,
SimpleSymbolic to,
boolean includeTo) |
Range(SimpleSymbolic from,
boolean includeFrom,
SimpleSymbolic to,
boolean includeTo,
float certaintyFactor) |
Range(SimpleSymbolic from,
SimpleSymbolic to)
Range constructor that sets the range boundaries according to given parameters.
|
Range(SimpleSymbolic from,
SimpleSymbolic to,
float certaintyFactor)
Range constructor that sets the range boundaries according to given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
int |
cardinality(Type t)
This returns number of elements in a set.
|
Value |
clone() |
boolean |
eq(Value v,
Type t)
A method that should be used to compare two values for equality.
|
Value |
except(Value v,
Type t)
An abstract method that should be used to calculate set that subtracts the value given as the parameter from the set.
|
Value |
getFrom()
Getter for a left boundary of a range.
|
Value |
getTo()
Getter for a right boundary of a range.
|
int |
hashCode() |
Value |
intersect(Value v,
Type t)
A method that should be used to calculate intersection with the value given as a parameter.
|
boolean |
isInTheDomain(Type t)
A method that searches for a value in a domain of
Type. |
boolean |
isLeftInclusive() |
boolean |
isRightInclusive() |
boolean |
neq(Value v,
Type t)
A method that should be used to compare two values for not equality.
|
boolean |
notsim(Value v,
Type t)
A method that should be used to check if the value has a nonempty intersection with a value given as a parameter.
|
void |
setLeftInclusive(boolean leftInclusive) |
void |
setRange(SimpleNumeric from,
SimpleNumeric to)
It sets the range boundaries.
|
void |
setRange(SimpleSymbolic from,
SimpleSymbolic to)
It sets the range boundaries.
|
void |
setRightInclusive(boolean rightInclusive) |
boolean |
sim(Value v,
Type t)
A method that should be used to check if the value has a nonempty intersection with a value given as a parameter.
|
boolean |
subset(Value v,
Type t)
A method that should be used to check is the value is a subset of value given as a parameter.
|
boolean |
supset(Value v,
Type t)
A method that should be used to check if the value is a superset of a value given as a parameter.
|
java.lang.String |
toString() |
Value |
union(Value v,
Type t)
A method that should be used to calculate a sum of two sets.
|
add, build, checkDomain, div, equals, evaluate, evaluateType, factorial, getCertaintyFactor, getTimestamp, gt, gte, in, lt, lte, mod, mul, notin, pow, powerset, setCertaintyFactor, setTimestamp, staticEvaluate, subpublic static final java.lang.String RANGE_SET_ERROR_MESSAGE
public static final java.lang.String EQ_ERROR_MESSAGE
public Range()
public Range(Range other)
from and to values.other - range to be copiedpublic Range(SimpleNumeric from, SimpleNumeric to) throws RangeFormatException
from - A left boundary of the rangeto - A right boundary of the rangeRangeFormatExceptionpublic Range(SimpleNumeric from, SimpleNumeric to, float certaintyFactor) throws RangeFormatException
from - A left boundary of the rangeto - A right boundary of the rangecertaintyFactor - A certainty factor that the range have inside given values.RangeFormatExceptionpublic Range(SimpleSymbolic from, SimpleSymbolic to) throws RangeFormatException
from - A left boundary of the rangeto - A right boundary of the rangeRangeFormatExceptionpublic Range(SimpleSymbolic from, SimpleSymbolic to, float certaintyFactor) throws RangeFormatException
from - A left boundary of the rangeto - A right boundary of the rangecertaintyFactor - A certainty factor that the range have inside given values.RangeFormatExceptionpublic Range(SimpleNumeric from, boolean includeFrom, SimpleNumeric to, boolean includeTo) throws RangeFormatException
RangeFormatExceptionpublic Range(SimpleSymbolic from, boolean includeFrom, SimpleSymbolic to, boolean includeTo) throws RangeFormatException
RangeFormatExceptionpublic Range(SimpleNumeric from, boolean includeFrom, SimpleNumeric to, boolean includeTo, float certaintyFactor) throws RangeFormatException
RangeFormatExceptionpublic Range(SimpleSymbolic from, boolean includeFrom, SimpleSymbolic to, boolean includeTo, float certaintyFactor) throws RangeFormatException
RangeFormatExceptionpublic boolean eq(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
ValueValue.ANY, function will return true immediately.eq in class Valuev - - a value to comparet - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.Value.ANY, false otherwise.java.lang.UnsupportedOperationException - in cases when operator is not applicable to the values being parameters of the operation.NotInTheDomainExceptionUnknownValueExceptionpublic boolean neq(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
ValueValue.eq(heart.alsvfd.Value, heart.xtt.Type).neq in class Valuev - - a value to comparet - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.java.lang.UnsupportedOperationException - in cases when operator is not applicable to the values being parameters of the operation.NotInTheDomainExceptionUnknownValueExceptionpublic boolean supset(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
Valuesupset in class Valuev - - a value to be processed. Both values should be a sets, or ranges.t - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.java.lang.UnsupportedOperationException - in cases when operator is not applicable to the values being parameters of the operation.NotInTheDomainExceptionUnknownValueExceptionpublic boolean subset(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
Valuesubset in class Valuev - - a value to be processed. Both values should be a sets, or ranges.t - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.java.lang.UnsupportedOperationException - in cases when operator is not applicable to the values being parameters of the operation.NotInTheDomainExceptionUnknownValueExceptionpublic boolean sim(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
Valuesim in class Valuev - - a value to be processed. Both values should be sets or ranges.t - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.java.lang.UnsupportedOperationException - in cases when operator is not applicable to the values being parameters of the operation.NotInTheDomainExceptionUnknownValueExceptionpublic boolean notsim(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
ValueValue.sim(heart.alsvfd.Value, heart.xtt.Type).notsim in class Valuev - - a value to be processed. Both values should be sets or ranges.t - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.java.lang.UnsupportedOperationException - in cases when operator is not applicable to the values being parameters of the operation.NotInTheDomainExceptionUnknownValueExceptionpublic Value intersect(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
Valueintersect in class Valuev - - a value to be processed. Both values should be a sets, or ranges.t - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.java.lang.UnsupportedOperationException - in cases when operator is not applicable to the values being parameters of the operation.NotInTheDomainExceptionUnknownValueExceptionpublic Value union(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
Valueunion in class Valuev - - a value to be processed. Both values should be a sets, or ranges.t - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.java.lang.UnsupportedOperationException - in cases when operator is not applicable to the values being parameters of the operation.NotInTheDomainExceptionUnknownValueExceptionpublic Value except(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
Valueexcept in class Valuev - - a value to be processed. It can be both simple type or general type.t - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.java.lang.UnsupportedOperationException - in cases when operator is not applicable to the values being parameters of the operation.NotInTheDomainExceptionUnknownValueExceptionpublic void setRange(SimpleSymbolic from, SimpleSymbolic to) throws RangeFormatException
from - left boundary of a rangeto - right boundary of a rangeRangeFormatExceptionpublic void setRange(SimpleNumeric from, SimpleNumeric to) throws RangeFormatException
from - left boundary of a rangeto - right boundary of a rangeRangeFormatExceptionpublic Value getFrom()
public Value getTo()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isLeftInclusive()
public void setLeftInclusive(boolean leftInclusive)
throws RangeFormatException
leftInclusive - the leftInclusive to setRangeFormatExceptionpublic boolean isRightInclusive()
public void setRightInclusive(boolean rightInclusive)
throws RangeFormatException
rightInclusive - the rightInclusive to setRangeFormatExceptionpublic boolean isInTheDomain(Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
ValueType.
This is useful if ordered field in SimpleSymbolic value is not known.
The method will return the value with its ordered number if exists.
If Null calls this method, false is always returned.
If Any calls this method true is returned if the domain is not empty.isInTheDomain in class Valuejava.lang.UnsupportedOperationExceptionNotInTheDomainExceptionUnknownValueExceptionpublic int cardinality(Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
NotInTheDomainExceptionjava.lang.UnsupportedOperationExceptionUnknownValueException