java.lang.Object
adaa.analytics.rules.logic.representation.valueset.SingletonSet
All Implemented Interfaces:
IValueSet, Serializable
Direct Known Subclasses:
SingletonSetComplement, UndefinedSet

public class SingletonSet extends Object implements IValueSet, Serializable
Value set containing one element.
See Also:
  • Field Details

    • value

      protected double value
      Value stored in a set
    • mapping

      protected List<String> mapping
      Mapping from value to label (null if no label exist).
  • Constructor Details

    • SingletonSet

      public SingletonSet(double v, List<String> mapping)
      Initializes members with arguments.
      Parameters:
      v - Singleton value.
      mapping - Mapping from value to label (can be null).
  • Method Details

    • getValue

      public double getValue()
      Gets value
    • setValue

      public void setValue(double v)
      Sets value
    • getValueAsString

      public String getValueAsString()
      Gets value as string
    • getMapping

      public List<String> getMapping()
      Gets mapping
    • setMapping

      public void setMapping(List<String> v)
      Sets mapping
    • 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 (see MissingValuesHandler).
      Specified by:
      contains in interface IValueSet
      Parameters:
      value - Value to be checked.
      Returns:
      Test result.
    • intersects

      public boolean intersects(IValueSet set)
      Checks if the value set intersects with another one.
      Specified by:
      intersects in interface IValueSet
      Parameters:
      set - Other value set.
      Returns:
      Test result.
    • equals

      public boolean equals(Object obj)
      Checks if the value set equals to other one.
      Specified by:
      equals in interface IValueSet
      Overrides:
      equals in class Object
      Parameters:
      obj - Object co cmopare with.
      Returns:
      Test result.
    • toString

      public String toString()
      Converts the value set to string.
      Specified by:
      toString in interface IValueSet
      Overrides:
      toString in class Object
      Returns:
      Text representation of the value set.
    • getIntersection

      public IValueSet getIntersection(IValueSet set)
      Gets intersection of the value set with another one.
      Specified by:
      getIntersection in interface IValueSet
      Parameters:
      set - Other value set.
      Returns:
      Intersection of sets.
    • hashCode

      public int hashCode()
      Calculates hashcode of the value set.
      Specified by:
      hashCode in interface IValueSet
      Overrides:
      hashCode in class Object
      Returns:
      Hashcode.
    • getDifference

      public List<IValueSet> getDifference(IValueSet set)
      Get difference between current value set and another one.
      Specified by:
      getDifference in interface IValueSet
      Parameters:
      set - Other value set.
      Returns:
      Difference of sets.