public class SetValue extends Value implements java.lang.Iterable<Value>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ERROR_MESSAGE |
protected java.util.List<Value> |
values
An ArrayList representing values of a set.
|
| Constructor and Description |
|---|
SetValue()
Default constructor.
|
SetValue(java.util.List<Value> values)
Constructor that assign values given as a parameter to values that
represents the set.
|
SetValue(java.util.List<Value> values,
float certaintyFactor)
Constructor that assign values given as a parameter to values that
represents the set.
|
SetValue(SetValue other) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendValue(Value v) |
void |
appendValues(SetValue sv) |
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.
|
java.util.List<Value> |
getValues() |
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 |
isEmpty() |
boolean |
isInTheDomain(Type t)
A method that searches for a value in a domain of
Type. |
java.util.Iterator<Value> |
iterator() |
Value |
max()
Method that search for the maximum value in a set.
|
Value |
min()
Method that search for the minimum value in a set.
|
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 |
setValues(java.util.List<Value> values) |
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 ERROR_MESSAGE
protected java.util.List<Value> values
public SetValue()
public SetValue(SetValue other)
public SetValue(java.util.List<Value> values)
values - to setpublic SetValue(java.util.List<Value> values, float certaintyFactor)
values - to setcertaintyFactor - A certainty factor that the set have inside given values.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 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 appendValue(Value v)
public void appendValues(SetValue sv)
public java.util.List<Value> getValues()
public void setValues(java.util.List<Value> values)
public boolean isEmpty()
public Value max() throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
java.lang.UnsupportedOperationExceptionNotInTheDomainExceptionUnknownValueExceptionpublic Value min() throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
java.lang.UnsupportedOperationExceptionNotInTheDomainExceptionUnknownValueExceptionpublic 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.UnsupportedOperationExceptionNotInTheDomainExceptionUnknownValueExceptionpublic int cardinality(Type t) throws java.lang.UnsupportedOperationException, NotInTheDomainException, UnknownValueException
t - type with respect to which the cardinality should be
calculated. This is important for the numeric rangesNotInTheDomainExceptionjava.lang.UnsupportedOperationExceptionUnknownValueException