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 TypeMethodDescriptionbooleancontains(double value) Checks whether the set contains a given value.booleanChecks 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.GetsmappingdoublegetValue()GetsvalueGetsvalueas stringinthashCode()Calculates hashcode of the value set.booleanintersects(IValueSet set) Checks if the value set intersects with another one.voidsetMapping(List<String> v) SetsmappingvoidsetValue(double v) SetsvaluetoString()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
Getsvalueas 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:
intersectsin 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:
getIntersectionin 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:
getDifferencein interfaceIValueSet- Parameters:
set- Other value set.- Returns:
- Difference of sets.
-