# SampleBasedCriterion (ARX API Documentation)

org.deidentifier.arx.criteria

## Class SampleBasedCriterion

- java.lang.Object
- - org.deidentifier.arx.criteria.PrivacyCriterion
  - - org.deidentifier.arx.criteria.SampleBasedCriterion

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    RiskBasedCriterion

      public abstract class SampleBasedCriterion
      extends PrivacyCriterion

  An abstract base class for sample-based privacy criteria.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SampleBasedCriterion(boolean monotonicWithSuppression, boolean monotonicWithGeneralization)` Instantiates a new criterion.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `enforce(org.deidentifier.arx.framework.check.groupify.HashGroupifyDistribution distribution, int numMaxSuppressedOutliers)` This method enforces the criterion on the current hash table.
    `boolean` | `isAnonymous(org.deidentifier.arx.framework.lattice.Transformation node, org.deidentifier.arx.framework.check.groupify.HashGroupifyEntry entry)` Not supported by this type of criterion
    `boolean` | `isSampleBased()` Is this criterion based on the overall sample

    - ### Methods inherited from class org.deidentifier.arx.criteria.PrivacyCriterion

      `clone, clone, getDataSubset, getMinimalClassSize, getPopulationModel, getRequirements, getRiskThresholdJournalist, getRiskThresholdMarketer, getRiskThresholdProsecutor, getSubset, initialize, isLocalRecodingSupported, isMinimalClassSizeAvailable, isMonotonicWithGeneralization, isMonotonicWithSuppression, isSubsetAvailable, render, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### SampleBasedCriterion

          public SampleBasedCriterion(boolean monotonicWithSuppression,
                              boolean monotonicWithGeneralization)

      Instantiates a new criterion.
      Parameters:
        `monotonicWithSuppression` -
        `monotonicWithGeneralization` -

  - ### Method Detail

    - #### enforce

          public abstract void enforce(org.deidentifier.arx.framework.check.groupify.HashGroupifyDistribution distribution,
                     int numMaxSuppressedOutliers)

      This method enforces the criterion on the current hash table. Criteria can be enforced by suppressing classes in the distribution by passing a PrivacyCondition. Criteria may abort early, if the threshold is reached (`distribution.getNumOfSuppressedTuples() > numMaxSuppressedOutliers`).
      Parameters:
        `distribution` -
        `numMaxSuppressedOutliers` -

    - #### isAnonymous

          public boolean isAnonymous(org.deidentifier.arx.framework.lattice.Transformation node,
                            org.deidentifier.arx.framework.check.groupify.HashGroupifyEntry entry)

      Not supported by this type of criterion
      Specified by:
        `isAnonymous` in class `PrivacyCriterion`
      Parameters:
        `entry` -
        `node` - TODO
      Returns:

    - #### isSampleBased

          public boolean isSampleBased()

      Description copied from class: `PrivacyCriterion`
      Is this criterion based on the overall sample
      Overrides:
        `isSampleBased` in class `PrivacyCriterion`
      Returns: