public class SimpleNumeric extends Value
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
INF_MINUS |
static java.lang.String |
INF_PLUS |
| Constructor and Description |
|---|
SimpleNumeric()
Default constructor that sets the value to null
|
SimpleNumeric(java.lang.Double value) |
SimpleNumeric(java.lang.Double value,
float certaintyFactor) |
SimpleNumeric(SimpleNumeric other) |
| Modifier and Type | Method and Description |
|---|---|
Value |
add(Value v,
Type t)
A method that should be used to calculate sum between a value represented
by an object that calls the method and a value given as a parameter.
|
Value |
clone() |
Value |
div(Value v,
Type t)
A method that should be used to calculate integral between a value represented
by an object that calls the method and a value given as a parameter.
|
boolean |
eq(Value v,
Type t)
A method that should be used to compare two values for equality.
|
Value |
factorial()
A method that should be used to calculate factorial of the value represented by an object that calls the method.
|
java.lang.Double |
getValue() |
boolean |
gt(Value v,
Type t)
A method that should be used to compare two values.
|
boolean |
gte(Value v,
Type t)
A method that should be used to compare two values.
|
int |
hashCode() |
boolean |
in(Value v,
Type t)
An operator that should be used to check membership of a value of an object that calls the method
within a value given by the parameter.
|
boolean |
isInTheDomain(Type t)
A method that searches for a value in a domain of
Type. |
boolean |
lt(Value v,
Type t)
A method that should be used to compare two values.
|
boolean |
lte(Value v,
Type t)
A method that should be used to compare two values.
|
Value |
mod(Value v,
Type t)
A method that should be used to calculate modulo integral between a value represented
by an object that calls the method and a value given as a parameter.
|
Value |
mul(Value v,
Type t)
A method that should be used to calculate multiplication between a value represented
by an object that calls the method and a value given as a parameter.
|
boolean |
neq(Value v,
Type t)
A method that should be used to compare two values for not equality.
|
boolean |
notin(Value v,
Type t)
An operator that should be used to check membership of a value of an object that calls the method
within a value given by the parameter.
|
Value |
pow(Value v,
Type t)
A method that should be used to calculate power of a value represented
by an object that calls the method to the value given as a parameter.
|
void |
setValue(java.lang.Double value) |
Value |
sub(Value v,
Type t)
A method that should be used to calculate difference between a value represented
by an object that calls the method and a value given as a parameter.
|
java.lang.String |
toString() |
build, checkDomain, equals, evaluate, evaluateType, except, getCertaintyFactor, getTimestamp, intersect, notsim, powerset, setCertaintyFactor, setTimestamp, sim, staticEvaluate, subset, supset, unionpublic static final java.lang.String INF_PLUS
public static final java.lang.String INF_MINUS
public SimpleNumeric()
public SimpleNumeric(java.lang.Double value)
public SimpleNumeric(java.lang.Double value,
float certaintyFactor)
public SimpleNumeric(SimpleNumeric other)
public 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 gt(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
ValueSimpleNumeric, but also in simple classes that introduce order in domain,
like SimpleSymbolic with ordered domain.gt 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 gte(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
ValueSimpleNumeric, but also in simple classes that introduce order in domain,
like SimpleSymbolic with ordered domain.gte 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 lt(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
ValueSimpleNumeric, but also in simple classes that introduce order in domain,
like SimpleSymbolic with ordered domain.lt 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 lte(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
ValueSimpleNumeric, but also in simple classes that introduce order in domain,
like SimpleSymbolic with ordered domain.lte 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 in(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
ValueSetValue.in in class Valuev - - a value to be processedt - - 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 notin(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
ValueValue.in(heart.alsvfd.Value, heart.xtt.Type).
The value of the parameter is intended to be a SetValue.notin in class Valuev - - a value to be processedt - - 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 mul(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
Valuemul in class Valuev - - a value to be processed. It should be a numerical 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 Value sub(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
Valuesub in class Valuev - - a value to be processed. It should be a numerical type, or ordered symbolic.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 div(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
Valuediv in class Valuev - - a value to be processed. It should be a numerical 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 Value add(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
Valueadd in class Valuev - - a value to be processed. It should be a numerical type, or ordered symbolic.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 pow(Value v, Type t) throws NotInTheDomainException, UnknownValueException
Valuepow in class Valuev - - a value to be processed. It should be a numerical type.t - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.NotInTheDomainExceptionUnknownValueExceptionpublic Value factorial()
Valuepublic Value mod(Value v, Type t) throws NotInTheDomainException, UnknownValueException
Valuemod in class Valuev - - a value to be processed. It should be a numerical type.t - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.NotInTheDomainExceptionUnknownValueExceptionpublic java.lang.Double getValue()
public void setValue(java.lang.Double value)
public java.lang.String toString()
toString in class java.lang.Objectpublic 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.UnsupportedOperationExceptionNotInTheDomainExceptionUnknownValueException