Class SingletonSet
java.lang.Object
adaa.analytics.rules.logic.representation.valueset.SingletonSet
- All Implemented Interfaces:
IValueSet
,Serializable
- Direct Known Subclasses:
SingletonSetComplement
,UndefinedSet
Value set containing one element.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSingletonSet
(double v, List<String> mapping) Initializes members with arguments. -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(double value) Checks whether the set contains a given value.boolean
Checks if the value set equals to other one.getDifference
(IValueSet set) Get difference between current value set and another one.getIntersection
(IValueSet set) Gets intersection of the value set with another one.Getsmapping
double
getValue()
Getsvalue
Getsvalue
as stringint
hashCode()
Calculates hashcode of the value set.boolean
intersects
(IValueSet set) Checks if the value set intersects with another one.void
setMapping
(List<String> v) Setsmapping
void
setValue
(double v) Setsvalue
toString()
Converts the value set to string.
-
Field Details
-
value
protected double valueValue stored in a set -
mapping
Mapping from value to label (null if no label exist).
-
-
Constructor Details
-
SingletonSet
Initializes members with arguments.- Parameters:
v
- Singleton value.mapping
- Mapping from value to label (can be null).
-
-
Method Details
-
getValue
public double getValue()Getsvalue
-
setValue
public void setValue(double v) Setsvalue
-
getValueAsString
Getsvalue
as string -
getMapping
Getsmapping
-
setMapping
Setsmapping
-
contains
public boolean contains(double value) Checks whether the set contains a given value. If the value is missing (NaN), the behaviour depends on the missing value policy (seeMissingValuesHandler
). -
intersects
Checks if the value set intersects with another one.- Specified by:
intersects
in interfaceIValueSet
- Parameters:
set
- Other value set.- Returns:
- Test result.
-
equals
Checks if the value set equals to other one. -
toString
Converts the value set to string. -
getIntersection
Gets intersection of the value set with another one.- Specified by:
getIntersection
in interfaceIValueSet
- Parameters:
set
- Other value set.- Returns:
- Intersection of sets.
-
hashCode
public int hashCode()Calculates hashcode of the value set. -
getDifference
Get difference between current value set and another one.- Specified by:
getDifference
in interfaceIValueSet
- Parameters:
set
- Other value set.- Returns:
- Difference of sets.
-