Class Anonymizer.DoubleAnonymizer

Enclosing class:
Anonymizer

public class Anonymizer.DoubleAnonymizer extends Anonymizer.AbstractAnonymizer<Double,Anonymizer.DoubleAnonymizer>
Anonymizer used to obfuscate a fields containing double values. If the context doesn't contains the field assigned to this instance, all'the method of this class will not change the context.
  • Constructor Details

    • DoubleAnonymizer

      protected DoubleAnonymizer(String field)
  • Method Details

    • anonymize

      public Anonymizer.DoubleAnonymizer anonymize()
      Set a random double (between Double.MIN_VALUE and Double.MAX_VALUE) as value of the field assigned to this instance.
      Returns:
      a reference of this object.
    • anonymize

      public Anonymizer.DoubleAnonymizer anonymize(double offset)
      Generate a random double number within the neighbourhood of the current field's value and set it as value of the field assigned to this instance.
      Parameters:
      offset - the size of the neighbourhood. The random value will be included between currentValue - offset and currentValue + offset
      Returns:
      a reference of this object.
      Throws:
      overit.geocall.asserts.AssertsException - if offset is negative.
    • anonymize

      public Anonymizer.DoubleAnonymizer anonymize(double from, double to)
      Generate a random double number between a given range and set it as value of the field assigned to this instance.
      Parameters:
      from - the lower bound value (included).
      to - the lower upper value (excluded).
      Returns:
      a reference of this object.
      Throws:
      overit.geocall.asserts.AssertsException - if lower bound value is greater equals than the upper bound ones.
    • anonymize

      protected Anonymizer.DoubleAnonymizer anonymize(Double from, Double to)