public abstract class Value extends java.lang.Object implements ExpressionInterface, ExpressionBuilderInterface
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ANY
A meta value ID representing any value.
|
static java.lang.String |
NULL
A meta value ID representing a state of absolute lack of knowledge about the attribute value.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Value()
This is the constructor that is invoked every time a Value is being created.
|
| 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.
|
ExpressionInterface |
build(java.util.Map<java.lang.String,Attribute> atts) |
protected void |
checkDomain(Value v,
Type t)
Checks if current instance and specified value are in the domain
|
abstract 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.
|
abstract boolean |
eq(Value v,
Type t)
A method that should be used to compare two values for equality.
|
boolean |
equals(java.lang.Object obj) |
Value |
evaluate(WorkingMemory wm) |
Type |
evaluateType(WorkingMemory wm)
A value should always return null for the type.
|
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 |
factorial()
A method that should be used to calculate factorial of the value represented by an object that calls the method.
|
float |
getCertaintyFactor()
A method used to get the certainty factor of a value.
|
long |
getTimestamp()
Returns the time when the value was achieved.
|
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.
|
abstract 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.
|
Value |
intersect(Value v,
Type t)
A method that should be used to calculate intersection with the value given as a parameter.
|
abstract 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.
|
abstract 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.
|
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.
|
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.
|
Value |
powerset()
An abstract method that should be used to calculate powerset of a value represented by an object that
calls the method.
|
void |
setCertaintyFactor(float certaintyFactor)
Sets the certainty factor of a value.
|
void |
setTimestamp(long timestamp)
Sets the timestamp of the value.
|
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.
|
Value |
staticEvaluate(java.util.Map<java.lang.String,Attribute> atts) |
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.
|
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.
|
Value |
union(Value v,
Type t)
A method that should be used to calculate a sum of two sets.
|
public static final java.lang.String ANY
public static final java.lang.String NULL
protected Value()
public abstract boolean eq(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
ANY, function will return true immediately.v - - a value to comparet - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.ANY, false otherwise.java.lang.UnsupportedOperationException - in cases when operator is not applicable to the values being parameters of the operation.NotInTheDomainExceptionUnknownValueExceptionpublic abstract boolean neq(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
eq(heart.alsvfd.Value, heart.xtt.Type).v - - 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
SimpleNumeric, but also in simple classes that introduce order in domain,
like SimpleSymbolic with ordered domain.v - - 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
SimpleNumeric, but also in simple classes that introduce order in domain,
like SimpleSymbolic with ordered domain.v - - a value to comparet - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.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
SimpleNumeric, but also in simple classes that introduce order in domain,
like SimpleSymbolic with ordered domain.v - - 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
SimpleNumeric, but also in simple classes that introduce order in domain,
like SimpleSymbolic with ordered domain.v - - a value to comparet - - a type with respect to witch the operator should work. If null, no domain is taken into consideration while evaluating.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
SetValue.v - - 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
in(heart.alsvfd.Value, heart.xtt.Type).
The value of the parameter is intended to be a SetValue.v - - 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 supset(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
v - - 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
v - - 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
v - - 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
sim(heart.alsvfd.Value, heart.xtt.Type).v - - 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
v - - 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
v - - 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
v - - 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 Value mul(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
v - - 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
v - - 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
v - - 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
v - - 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 java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
v - - 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 mod(Value v, Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
v - - 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 factorial() throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
java.lang.UnsupportedOperationException - in cases when operator is not applicable to the values being parameters of the operation.NotInTheDomainExceptionUnknownValueExceptionpublic Value powerset() throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
java.lang.UnsupportedOperationException - in cases when operator is not applicable to the values being parameters of the operation.NotInTheDomainExceptionUnknownValueExceptionpublic abstract boolean isInTheDomain(Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
Type.
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.NotInTheDomainExceptionjava.lang.UnsupportedOperationExceptionUnknownValueExceptionpublic float getCertaintyFactor()
public void setCertaintyFactor(float certaintyFactor)
certaintyFactor - protected void checkDomain(Value v, Type t) throws NotInTheDomainException, UnknownValueException
v - - a value to be processed. It may be any of the Value implementation class.t - - a type with respect to witch the operator should work.NotInTheDomainException - thrown if either this instance or v param is not in the domainUnknownValueExceptionpublic long getTimestamp()
public void setTimestamp(long timestamp)
timestamp - public Value evaluate(WorkingMemory wm)
evaluate in interface ExpressionInterfacepublic ExpressionInterface build(java.util.Map<java.lang.String,Attribute> atts) throws BuilderException
build in interface ExpressionBuilderInterfaceBuilderExceptionpublic Value staticEvaluate(java.util.Map<java.lang.String,Attribute> atts) throws StaticEvaluationException
staticEvaluate in interface ExpressionBuilderInterfaceStaticEvaluationExceptionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic abstract int hashCode()
hashCode in class java.lang.Objectpublic abstract Value clone()
clone in class java.lang.Objectpublic Type evaluateType(WorkingMemory wm)
evaluateType in interface ExpressionInterfacewm - The WorkingMemory object with respect to which a type of an expression should be evaluated