# DataHandle (ARX GUI Documentation)

org.deidentifier.arx

## Class DataHandle

- java.lang.Object
- - org.deidentifier.arx.DataHandle

- Direct Known Subclasses:
    DataHandleInput, DataHandleOutput, DataHandleSubset

      public abstract class DataHandle
      extends java.lang.Object

  This class provides access to dictionary encoded data. Furthermore, the data is linked to the associated input or output data. This means that, e.g., if the input data is sorted, the output data will be sorted accordingly. This ensures that original tuples and their generalized counterpart will always have the same row index, which is important for many use cases, e.g., for graphical tools that allow to compare the original dataset to generalized versions.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DataType<?>[][]` | `dataTypes` The data types.
    `protected DataDefinition` | `definition` The data definition.
    `protected java.lang.String[]` | `header` The header.
    `protected ARXLattice.ARXNode` | `node` The node.
    `protected org.deidentifier.arx.DataRegistry` | `registry` The current registry.
    `protected DataHandle` | `subset` The current research subset.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataHandle()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkColumn(int column1)` Checks a column index.
    `protected void` | `checkColumns(int[] columns)` Checks the column indexes.
    `protected void` | `checkRegistry()` Checks whether a registry is referenced.
    `protected void` | `checkRow(int row1, int length)` Checks a row index.
    `protected abstract void` | `doRelease()` Releases all resources.
    `abstract java.lang.String` | `getAttributeName(int col)` Returns the name of the specified column.
    `protected DataType<?>` | `getBaseDataType(java.lang.String attribute)` Returns the base data type without generalization.
    `int` | `getColumnIndexOf(java.lang.String attribute)` Returns the index of the given attribute, -1 if it is not in the header.
    `protected abstract ARXConfiguration` | `getConfiguration()` Returns the ARXConfiguration that is currently being used, null if this is an input handle
    `DataType<?>` | `getDataType(java.lang.String attribute)` Returns the according data type.
    `protected abstract DataType<?>[][]` | `getDataTypeArray()` Generates an array of data types.
    `java.util.Date` | `getDate(int row, int col)` Returns a date/time value from the specified cell.
    `DataDefinition` | `getDefinition()` Returns the data definition.
    `java.lang.String[]` | `getDistinctValues(int column)` Returns an array containing the distinct values in the given column.
    `protected abstract java.lang.String[]` | `getDistinctValues(int column, boolean ignoreSuppression, DataHandleInternal.InterruptHandler handler)` Returns the distinct values.
    `java.lang.Double` | `getDouble(int row, int col)` Returns a double value from the specified cell.
    `java.lang.Float` | `getFloat(int row, int col)` Returns a float value from the specified cell.
    `abstract int` | `getGeneralization(java.lang.String attribute)` Returns the generalization level for the attribute.
    `java.lang.Integer` | `getInt(int row, int col)` Returns an int value from the specified cell.
    `java.lang.Long` | `getLong(int row, int col)` Returns a long value from the specified cell.
    `java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>>` | `getMatchingDataTypes(int column)` Returns a mapping from data types to the relative number of values that conform to the according type.
    `<U> java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>>` | `getMatchingDataTypes(int column, java.lang.Class<U> clazz)` Returns a mapping from data types to the relative number of values that conform to the according type for a given wrapped class.
    `<U> java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>>` | `getMatchingDataTypes(int column, java.lang.Class<U> clazz, double threshold)` Returns a mapping from data types to the relative number of values that conform to the according type for a given wrapped class.
    `<U> java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>>` | `getMatchingDataTypes(int column, java.lang.Class<U> clazz, java.util.Locale locale)` Returns a mapping from data types to the relative number of values that conform to the according type for a given wrapped class.
    `<U> java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>>` | `getMatchingDataTypes(int column, java.lang.Class<U> clazz, java.util.Locale locale, double threshold)` Returns a mapping from data types to the relative number of values that conform to the according type for a given wrapped class.
    `java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>>` | `getMatchingDataTypes(int column, double threshold)` Returns a mapping from data types to the relative number of values that conform to the according type.
    `java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>>` | `getMatchingDataTypes(int column, java.util.Locale locale)` Returns a mapping from data types to the relative number of values that conform to the according type This method only returns types that match at least 80% of all values in the column .
    `java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>>` | `getMatchingDataTypes(int column, java.util.Locale locale, double threshold)` Returns a mapping from data types to the relative number of values that conform to the according type.
    `java.lang.String[]` | `getNonConformingValues(int column, DataType<?> type, int max)` Returns a set of values that do not conform to the given data type.
    `abstract int` | `getNumColumns()` Returns the number of columns in the dataset.
    `int` | `getNumConformingValues(int column, DataType<?> type)` Returns the number of (distinct) values that conform to the given data type.
    `abstract int` | `getNumRows()` Returns the number of rows in the dataset.
    `protected org.deidentifier.arx.DataRegistry` | `getRegistry()` Returns the registry associated with this handle.
    `RiskEstimateBuilder` | `getRiskEstimator(ARXPopulationModel model)` Returns a risk estimator
    `RiskEstimateBuilder` | `getRiskEstimator(ARXPopulationModel model, ARXSolverConfiguration config)` Returns a risk estimator
    `RiskEstimateBuilder` | `getRiskEstimator(ARXPopulationModel model, RiskModelHistogram classes)` Returns a risk estimator for the given set of equivalence classes.
    `RiskEstimateBuilder` | `getRiskEstimator(ARXPopulationModel model, RiskModelHistogram classes, ARXSolverConfiguration config)` Returns a risk estimator for the given set of equivalence classes.
    `RiskEstimateBuilder` | `getRiskEstimator(ARXPopulationModel model, java.util.Set<java.lang.String> qis)` Returns a risk estimator for the given set of quasi-identifiers
    `RiskEstimateBuilder` | `getRiskEstimator(ARXPopulationModel model, java.util.Set<java.lang.String> qis, ARXSolverConfiguration config)` Returns a risk estimator for the given set of quasi-identifiers
    `abstract StatisticsBuilder` | `getStatistics()` Returns an object providing access to basic descriptive statistics about the data represented by this handle.
    `ARXLattice.ARXNode` | `getTransformation()` Returns the transformation .
    `abstract java.lang.String` | `getValue(int row, int col)` Returns the value in the specified cell.
    `DataHandle` | `getView()` Returns a new data handle that represents a context specific view on the dataset.
    `protected int` | `internalCompare(int row1, int row2, int[] columns, boolean ascending)` A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
    `protected abstract java.lang.String` | `internalGetValue(int row, int col, boolean ignoreSuppression)` Internal representation of get value.
    `protected abstract boolean` | `internalReplace(int column, java.lang.String original, java.lang.String replacement)` Internal replacement method.
    `protected boolean` | `isAnonymous()` Returns whether the data represented by this handle is anonymous
    `boolean` | `isOptimized()` Has this handle been optimized with local recoding?
    `boolean` | `isOrphaned()` Determines whether this handle is orphaned, i.e., should not be used anymore
    `boolean` | `isOutlier(int row)` Determines whether a given row is an outlier in the currently associated data transformation.
    `abstract java.util.Iterator<java.lang.String[]>` | `iterator()` Returns an iterator over the data.
    `void` | `release()` Releases this handle and all associated resources.
    `ElementData` | `render()` Renders this object
    `boolean` | `replace(int column, java.lang.String original, java.lang.String replacement)` Replaces the original value with the replacement in the given column.
    `void` | `save(java.io.File file)` Writes the data to a CSV file.
    `void` | `save(java.io.File file, char separator)` Writes the data to a CSV file.
    `void` | `save(java.io.File file, CSVSyntax config)` Writes the data to a CSV file.
    `void` | `save(java.io.OutputStream out)` Writes the data to a CSV file.
    `void` | `save(java.io.OutputStream out, char separator)` Writes the data to a CSV file.
    `void` | `save(java.io.OutputStream out, CSVSyntax config)` Writes the data to a CSV file.
    `void` | `save(java.lang.String path)` Writes the data to a CSV file.
    `void` | `save(java.lang.String path, char separator)` Writes the data to a CSV file.
    `void` | `save(java.lang.String path, CSVSyntax config)` Writes the data to a CSV file.
    `protected void` | `setRegistry(org.deidentifier.arx.DataRegistry registry)` Updates the registry.
    `protected void` | `setView(DataHandle handle)` Sets the subset.
    `void` | `sort(boolean ascending, int... columns)` Sorts the dataset according to the given columns.
    `void` | `sort(int from, int to, boolean ascending, int... columns)` Sorts the dataset according to the given columns and the given range.
    `void` | `sort(cern.colt.Swapper swapper, boolean ascending, int... columns)` Sorts the dataset according to the given columns.
    `void` | `sort(cern.colt.Swapper swapper, int from, int to, boolean ascending, int... columns)` Sorts the dataset according to the given columns and the given range.
    `void` | `swap(int row1, int row2)` Swaps both rows.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### dataTypes

          protected DataType<?>[][] dataTypes

      The data types.

    - #### definition

          protected DataDefinition definition

      The data definition.

    - #### header

          protected java.lang.String[] header

      The header.

    - #### node

          protected ARXLattice.ARXNode node

      The node.

    - #### registry

          protected org.deidentifier.arx.DataRegistry registry

      The current registry.

    - #### subset

          protected DataHandle subset

      The current research subset.

  - ### Constructor Detail

    - #### DataHandle

          public DataHandle()

  - ### Method Detail

    - #### getAttributeName

          public abstract java.lang.String getAttributeName(int col)

      Returns the name of the specified column.
      Parameters:
        `col` - The column index
      Returns:
        the attribute name

    - #### getColumnIndexOf

          public int getColumnIndexOf(java.lang.String attribute)

      Returns the index of the given attribute, -1 if it is not in the header.
      Parameters:
        `attribute` - the attribute
      Returns:
        the column index of

    - #### getDataType

          public DataType<?> getDataType(java.lang.String attribute)

      Returns the according data type.
      Parameters:
        `attribute` - the attribute
      Returns:
        the data type

    - #### getDate

          public java.util.Date getDate(int row,
                               int col)
                                 throws java.text.ParseException

      Returns a date/time value from the specified cell.
      Parameters:
        `row` - The cell's row index
        `col` - The cell's column index
      Returns:
        the date
      Throws:
        `java.text.ParseException` - the parse exception

    - #### getDefinition

          public DataDefinition getDefinition()

      Returns the data definition.
      Returns:
        the definition

    - #### getDistinctValues

          public final java.lang.String[] getDistinctValues(int column)

      Returns an array containing the distinct values in the given column.
      Parameters:
        `column` - The column to process
      Returns:
        the distinct values

    - #### getDouble

          public java.lang.Double getDouble(int row,
                                   int col)
                                     throws java.text.ParseException

      Returns a double value from the specified cell.
      Parameters:
        `row` - The cell's row index
        `col` - The cell's column index
      Returns:
        the double
      Throws:
        `java.text.ParseException` - the parse exception

    - #### getFloat

          public java.lang.Float getFloat(int row,
                                 int col)
                                   throws java.text.ParseException

      Returns a float value from the specified cell.
      Parameters:
        `row` - The cell's row index
        `col` - The cell's column index
      Returns:
        the float
      Throws:
        `java.text.ParseException` - the parse exception

    - #### getGeneralization

          public abstract int getGeneralization(java.lang.String attribute)

      Returns the generalization level for the attribute.
      Parameters:
        `attribute` - the attribute
      Returns:
        the generalization

    - #### getInt

          public java.lang.Integer getInt(int row,
                                 int col)
                                   throws java.text.ParseException

      Returns an int value from the specified cell.
      Parameters:
        `row` - The cell's row index
        `col` - The cell's column index
      Returns:
        the int
      Throws:
        `java.text.ParseException` - the parse exception

    - #### getLong

          public java.lang.Long getLong(int row,
                               int col)
                                 throws java.text.ParseException

      Returns a long value from the specified cell.
      Parameters:
        `row` - The cell's row index
        `col` - The cell's column index
      Returns:
        the long
      Throws:
        `java.text.ParseException` - the parse exception

    - #### getMatchingDataTypes

          public java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>> getMatchingDataTypes(int column)

      Returns a mapping from data types to the relative number of values that conform to the according type. This method uses the default locale. This method only returns types that match at least 80% of all values in the column .
      Parameters:
        `column` - the column
      Returns:
        the matching data types

    - #### getMatchingDataTypes

          public <U> java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>> getMatchingDataTypes(int column,
                                                                                                                  java.lang.Class<U> clazz)

      Returns a mapping from data types to the relative number of values that conform to the according type for a given wrapped class. This method uses the default locale. This method only returns types that match at least 80% of all values in the column .
      Type Parameters:
        `U` - the generic type
      Parameters:
        `column` - the column
        `clazz` - The wrapped class
      Returns:
        the matching data types

    - #### getMatchingDataTypes

          public <U> java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>> getMatchingDataTypes(int column,
                                                                                                                  java.lang.Class<U> clazz,
                                                                                                                  double threshold)

      Returns a mapping from data types to the relative number of values that conform to the according type for a given wrapped class. This method uses the default locale.
      Type Parameters:
        `U` - the generic type
      Parameters:
        `column` - the column
        `clazz` - The wrapped class
        `threshold` - Relative minimal number of values that must match to include a data type in the results
      Returns:
        the matching data types

    - #### getMatchingDataTypes

          public <U> java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>> getMatchingDataTypes(int column,
                                                                                                                  java.lang.Class<U> clazz,
                                                                                                                  java.util.Locale locale)

      Returns a mapping from data types to the relative number of values that conform to the according type for a given wrapped class. This method only returns types that match at least 80% of all values in the column .
      Type Parameters:
        `U` - the generic type
      Parameters:
        `column` - the column
        `clazz` - The wrapped class
        `locale` - The locale to use
      Returns:
        the matching data types

    - #### getMatchingDataTypes

          public <U> java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>> getMatchingDataTypes(int column,
                                                                                                                  java.lang.Class<U> clazz,
                                                                                                                  java.util.Locale locale,
                                                                                                                  double threshold)

      Returns a mapping from data types to the relative number of values that conform to the according type for a given wrapped class.
      Type Parameters:
        `U` - the generic type
      Parameters:
        `column` - the column
        `clazz` - The wrapped class
        `locale` - The locale to use
        `threshold` - Relative minimal number of values that must match to include a data type in the results
      Returns:
        the matching data types

    - #### getMatchingDataTypes

          public java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>> getMatchingDataTypes(int column,
                                                                                                              double threshold)

      Returns a mapping from data types to the relative number of values that conform to the according type. This method uses the default locale.
      Parameters:
        `column` - the column
        `threshold` - Relative minimal number of values that must match to include a data type in the results
      Returns:
        the matching data types

    - #### getMatchingDataTypes

          public java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>> getMatchingDataTypes(int column,
                                                                                                              java.util.Locale locale)

      Returns a mapping from data types to the relative number of values that conform to the according type This method only returns types that match at least 80% of all values in the column .
      Parameters:
        `column` - the column
        `locale` - The locale to use
      Returns:
        the matching data types

    - #### getMatchingDataTypes

          public java.util.List<org.apache.commons.math3.util.Pair<DataType<?>,java.lang.Double>> getMatchingDataTypes(int column,
                                                                                                              java.util.Locale locale,
                                                                                                              double threshold)

      Returns a mapping from data types to the relative number of values that conform to the according type.
      Parameters:
        `column` - the column
        `locale` - The locale to use
        `threshold` - Relative minimal number of values that must match to include a data type in the results
      Returns:
        the matching data types

    - #### getNonConformingValues

          public java.lang.String[] getNonConformingValues(int column,
                                                  DataType<?> type,
                                                  int max)

      Returns a set of values that do not conform to the given data type.
      Parameters:
        `column` - The column to test
        `type` - The type to test
        `max` - The maximal number of values returned by this method
      Returns:
        the non conforming values

    - #### getNumColumns

          public abstract int getNumColumns()

      Returns the number of columns in the dataset.
      Returns:
        the num columns

    - #### getNumConformingValues

          public int getNumConformingValues(int column,
                                   DataType<?> type)

      Returns the number of (distinct) values that conform to the given data type.
      Parameters:
        `column` - The column to test
        `type` - The type to test
      Returns:
        the num conforming values

    - #### getNumRows

          public abstract int getNumRows()

      Returns the number of rows in the dataset.
      Returns:
        the num rows

    - #### getRiskEstimator

          public RiskEstimateBuilder getRiskEstimator(ARXPopulationModel model)

      Returns a risk estimator
      Parameters:
        `model` -
      Returns:

    - #### getRiskEstimator

          public RiskEstimateBuilder getRiskEstimator(ARXPopulationModel model,
                                             ARXSolverConfiguration config)

      Returns a risk estimator
      Parameters:
        `model` -
        `config` -
      Returns:

    - #### getRiskEstimator

          public RiskEstimateBuilder getRiskEstimator(ARXPopulationModel model,
                                             RiskModelHistogram classes)

      Returns a risk estimator for the given set of equivalence classes. Saves resources by re-using existing classes
      Parameters:
        `model` -
        `classes` -
      Returns:

    - #### getRiskEstimator

          public RiskEstimateBuilder getRiskEstimator(ARXPopulationModel model,
                                             RiskModelHistogram classes,
                                             ARXSolverConfiguration config)

      Returns a risk estimator for the given set of equivalence classes. Saves resources by re-using existing classes
      Parameters:
        `model` -
        `classes` -
        `config` -
      Returns:

    - #### getRiskEstimator

          public RiskEstimateBuilder getRiskEstimator(ARXPopulationModel model,
                                             java.util.Set<java.lang.String> qis)

      Returns a risk estimator for the given set of quasi-identifiers
      Parameters:
        `model` -
        `qis` -
      Returns:

    - #### getRiskEstimator

          public RiskEstimateBuilder getRiskEstimator(ARXPopulationModel model,
                                             java.util.Set<java.lang.String> qis,
                                             ARXSolverConfiguration config)

      Returns a risk estimator for the given set of quasi-identifiers
      Parameters:
        `model` -
        `qis` -
        `config` -
      Returns:

    - #### getStatistics

          public abstract StatisticsBuilder getStatistics()

      Returns an object providing access to basic descriptive statistics about the data represented by this handle.
      Returns:
        the statistics

    - #### getTransformation

          public ARXLattice.ARXNode getTransformation()

      Returns the transformation .
      Returns:
        the transformation

    - #### getValue

          public abstract java.lang.String getValue(int row,
                                  int col)

      Returns the value in the specified cell.
      Parameters:
        `row` - The cell's row index
        `col` - The cell's column index
      Returns:
        the value

    - #### getView

          public DataHandle getView()

      Returns a new data handle that represents a context specific view on the dataset.
      Returns:
        the view

    - #### isOptimized

          public boolean isOptimized()

      Has this handle been optimized with local recoding?
      Returns:

    - #### isOrphaned

          public boolean isOrphaned()

      Determines whether this handle is orphaned, i.e., should not be used anymore
      Returns:
        true, if is orphaned

    - #### isOutlier

          public boolean isOutlier(int row)

      Determines whether a given row is an outlier in the currently associated data transformation.
      Parameters:
        `row` - the row
      Returns:
        true, if is outlier

    - #### iterator

          public abstract java.util.Iterator<java.lang.String[]> iterator()

      Returns an iterator over the data.
      Returns:
        the iterator

    - #### release

          public void release()

      Releases this handle and all associated resources. If a input handle is released all associated results are released as well.

    - #### render

          public ElementData render()

      Renders this object
      Returns:

    - #### replace

          public boolean replace(int column,
                        java.lang.String original,
                        java.lang.String replacement)

      Replaces the original value with the replacement in the given column. Only supported by handles for input data.
      Parameters:
        `column` - the column
        `original` - the original
        `replacement` - the replacement
      Returns:
        Whether the original value was found

    - #### save

          public void save(java.io.File file)
                    throws java.io.IOException

      Writes the data to a CSV file.
      Parameters:
        `file` - the file
      Throws:
        `java.io.IOException` - Signals that an I/O exception has occurred.

    - #### save

          public void save(java.io.File file,
                  char separator)
                    throws java.io.IOException

      Writes the data to a CSV file.
      Parameters:
        `file` - A file
        `separator` - The utilized separator character
      Throws:
        `java.io.IOException` - Signals that an I/O exception has occurred.

    - #### save

          public void save(java.io.File file,
                  CSVSyntax config)
                    throws java.io.IOException

      Writes the data to a CSV file.
      Parameters:
        `file` - the file
        `config` - the config
      Throws:
        `java.io.IOException` - Signals that an I/O exception has occurred.

    - #### save

          public void save(java.io.OutputStream out)
                    throws java.io.IOException

      Writes the data to a CSV file.
      Parameters:
        `out` - the out
      Throws:
        `java.io.IOException` - Signals that an I/O exception has occurred.

    - #### save

          public void save(java.io.OutputStream out,
                  char separator)
                    throws java.io.IOException

      Writes the data to a CSV file.
      Parameters:
        `out` - Output stream
        `separator` - The utilized separator character
      Throws:
        `java.io.IOException` - Signals that an I/O exception has occurred.

    - #### save

          public void save(java.io.OutputStream out,
                  CSVSyntax config)
                    throws java.io.IOException

      Writes the data to a CSV file.
      Parameters:
        `out` - the out
        `config` - the config
      Throws:
        `java.io.IOException` - Signals that an I/O exception has occurred.

    - #### save

          public void save(java.lang.String path)
                    throws java.io.IOException

      Writes the data to a CSV file.
      Parameters:
        `path` - the path
      Throws:
        `java.io.IOException` - Signals that an I/O exception has occurred.

    - #### save

          public void save(java.lang.String path,
                  char separator)
                    throws java.io.IOException

      Writes the data to a CSV file.
      Parameters:
        `path` - A path
        `separator` - The utilized separator character
      Throws:
        `java.io.IOException` - Signals that an I/O exception has occurred.

    - #### save

          public void save(java.lang.String path,
                  CSVSyntax config)
                    throws java.io.IOException

      Writes the data to a CSV file.
      Parameters:
        `path` - the path
        `config` - the config
      Throws:
        `java.io.IOException` - Signals that an I/O exception has occurred.

    - #### sort

          public void sort(boolean ascending,
                  int... columns)

      Sorts the dataset according to the given columns. Will sort input and output analogously.
      Parameters:
        `ascending` - Sort ascending or descending
        `columns` - An integer array containing column indicides

    - #### sort

          public void sort(int from,
                  int to,
                  boolean ascending,
                  int... columns)

      Sorts the dataset according to the given columns and the given range. Will sort input and output analogously.
      Parameters:
        `from` - The lower bound
        `to` - The upper bound
        `ascending` - Sort ascending or descending
        `columns` - An integer array containing column indicides

    - #### sort

          public void sort(cern.colt.Swapper swapper,
                  boolean ascending,
                  int... columns)

      Sorts the dataset according to the given columns. Will sort input and output analogously.
      Parameters:
        `swapper` - A swapper
        `ascending` - Sort ascending or descending
        `columns` - An integer array containing column indicides

    - #### sort

          public void sort(cern.colt.Swapper swapper,
                  int from,
                  int to,
                  boolean ascending,
                  int... columns)

      Sorts the dataset according to the given columns and the given range. Will sort input and output analogously.
      Parameters:
        `swapper` - A swapper
        `from` - The lower bound
        `to` - The upper bound
        `ascending` - Sort ascending or descending
        `columns` - An integer array containing column indicides

    - #### swap

          public void swap(int row1,
                  int row2)

      Swaps both rows.
      Parameters:
        `row1` - the row1
        `row2` - the row2

    - #### checkColumn

          protected void checkColumn(int column1)

      Checks a column index.
      Parameters:
        `column1` - the column1

    - #### checkColumns

          protected void checkColumns(int[] columns)

      Checks the column indexes.
      Parameters:
        `columns` - the columns

    - #### checkRegistry

          protected void checkRegistry()

      Checks whether a registry is referenced.

    - #### checkRow

          protected void checkRow(int row1,
                      int length)

      Checks a row index.
      Parameters:
        `row1` - the row1
        `length` - the length

    - #### doRelease

          protected abstract void doRelease()

      Releases all resources.

    - #### getBaseDataType

          protected DataType<?> getBaseDataType(java.lang.String attribute)

      Returns the base data type without generalization.
      Parameters:
        `attribute` - the attribute
      Returns:
        the base data type

    - #### getConfiguration

          protected abstract ARXConfiguration getConfiguration()

      Returns the ARXConfiguration that is currently being used, null if this is an input handle
      Returns:

    - #### getDataTypeArray

          protected abstract DataType<?>[][] getDataTypeArray()

      Generates an array of data types.
      Returns:
        the data type array

    - #### getDistinctValues

          protected abstract java.lang.String[] getDistinctValues(int column,
                                             boolean ignoreSuppression,
                                             DataHandleInternal.InterruptHandler handler)

      Returns the distinct values.
      Parameters:
        `column` - the column
        `ignoreSuppression` -
        `handler` - the handler
      Returns:
        the distinct values

    - #### getRegistry

          protected org.deidentifier.arx.DataRegistry getRegistry()

      Returns the registry associated with this handle.
      Returns:
        the registry

    - #### internalCompare

          protected int internalCompare(int row1,
                            int row2,
                            int[] columns,
                            boolean ascending)

      A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second. It uses the specified data types for comparison. If no datatype is specified for a specific column it uses string comparison.
      Parameters:
        `row1` - the row1
        `row2` - the row2
        `columns` - the columns
        `ascending` - the ascending
      Returns:
        the int

    - #### internalGetValue

          protected abstract java.lang.String internalGetValue(int row,
                                          int col,
                                          boolean ignoreSuppression)

      Internal representation of get value.
      Parameters:
        `row` - the row
        `col` - the col
      Returns:
        the string

    - #### internalReplace

          protected abstract boolean internalReplace(int column,
                                java.lang.String original,
                                java.lang.String replacement)

      Internal replacement method.
      Parameters:
        `column` - the column
        `original` - the original
        `replacement` - the replacement
      Returns:
        true, if successful

    - #### isAnonymous

          protected boolean isAnonymous()

      Returns whether the data represented by this handle is anonymous
      Returns:

    - #### setRegistry

          protected void setRegistry(org.deidentifier.arx.DataRegistry registry)

      Updates the registry.
      Parameters:
        `registry` - the new registry

    - #### setView

          protected void setView(DataHandle handle)

      Sets the subset.
      Parameters:
        `handle` - the new view