# DataHandleInput (ARX Developer Documentation)

org.deidentifier.arx

## Class DataHandleInput

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

-     public class DataHandleInput
      extends DataHandle

  An implementation of the DataHandle interface for input data.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int[][]` | `data` The data.
    `protected Dictionary` | `dictionary` The dictionary.

    - ### Fields inherited from class org.deidentifier.arx.DataHandle

      `dataTypes, definition, header, node, registry, subset`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `DataHandleInput(Data data)` Creates a new data handle.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doRelease()` Releases all resources.
    `java.lang.String` | `getAttributeName(int column)` Returns the name of the specified column.
    `protected DataType<?>` | `getBaseDataType(java.lang.String attribute)` Returns the base data type without generalization.
    `protected ARXConfiguration` | `getConfiguration()` Returns the ARXConfiguration that is currently being used, null if this is an input handle
    `protected DataType<?>[][]` | `getDataTypeArray()` Generates an array of data types.
    `protected java.lang.String[]` | `getDistinctValues(int column, boolean ignoreSuppression, DataHandleInternal.InterruptHandler handler)` Returns the distinct values.
    `int` | `getGeneralization(java.lang.String attribute)` Returns the generalization level for the attribute.
    `protected int[][]` | `getInputBuffer()` Returns the input buffer
    `int` | `getNumColumns()` Returns the number of columns in the dataset.
    `int` | `getNumRows()` Returns the number of rows in the dataset.
    `StatisticsBuilder` | `getStatistics()` Returns an object providing access to basic descriptive statistics about the data represented by this handle.
    `java.lang.String` | `getValue(int row, int column)` Returns the value in the specified cell.
    `protected java.lang.String` | `internalGetValue(int row, int column, boolean ignoreSuppression)` Internal representation of get value.
    `protected boolean` | `internalReplace(int column, java.lang.String original, java.lang.String replacement)` Internal replacement method.
    `protected void` | `internalSwap(int row1, int row2)` Swaps the rows.
    `protected boolean` | `isLocked()` Is this handle locked?.
    `boolean` | `isOutlier(int row)` Determines whether a given row is an outlier in the currently associated data transformation.
    `java.util.Iterator<java.lang.String[]>` | `iterator()` Returns an iterator over the data.
    `protected void` | `setDefinition(DataDefinition definition)` Overrides the handles data definition.
    `protected void` | `setLocked(boolean locked)` Lock/unlock this handle.
    `protected void` | `update(Data data)` Update the definition.
    `protected void` | `update(int[][] dataGH, int[][] dataDI, int[][] dataIS)` Updates the definition with further data to swap.

    - ### Methods inherited from class org.deidentifier.arx.DataHandle

      `checkColumn, checkColumns, checkRegistry, checkRow, getColumnIndexOf, getDataType, getDate, getDefinition, getDistinctValues, getDouble, getFloat, getInt, getLong, getMatchingDataTypes, getMatchingDataTypes, getMatchingDataTypes, getMatchingDataTypes, getMatchingDataTypes, getMatchingDataTypes, getMatchingDataTypes, getMatchingDataTypes, getNonConformingValues, getNumConformingValues, getRegistry, getRiskEstimator, getRiskEstimator, getRiskEstimator, getRiskEstimator, getRiskEstimator, getRiskEstimator, getTransformation, getView, internalCompare, isAnonymous, isOptimized, isOrphaned, release, render, replace, save, save, save, save, save, save, save, save, save, setRegistry, setView, sort, sort, sort, sort, swap`

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

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

- - ### Field Detail

    - #### data

          protected int[][] data

      The data.

    - #### dictionary

          protected Dictionary dictionary

      The dictionary.

  - ### Constructor Detail

    - #### DataHandleInput

          protected DataHandleInput(Data data)

      Creates a new data handle.
      Parameters:
        `data` -

  - ### Method Detail

    - #### getAttributeName

          public java.lang.String getAttributeName(int column)

      Description copied from class: `DataHandle`
      Returns the name of the specified column.
      Specified by:
        `getAttributeName` in class `DataHandle`
      Parameters:
        `column` - The column index
      Returns:
        the attribute name

    - #### getGeneralization

          public int getGeneralization(java.lang.String attribute)

      Description copied from class: `DataHandle`
      Returns the generalization level for the attribute.
      Specified by:
        `getGeneralization` in class `DataHandle`
      Parameters:
        `attribute` - the attribute
      Returns:
        the generalization

    - #### getNumColumns

          public int getNumColumns()

      Description copied from class: `DataHandle`
      Returns the number of columns in the dataset.
      Specified by:
        `getNumColumns` in class `DataHandle`
      Returns:
        the num columns

    - #### getNumRows

          public int getNumRows()

      Description copied from class: `DataHandle`
      Returns the number of rows in the dataset.
      Specified by:
        `getNumRows` in class `DataHandle`
      Returns:
        the num rows

    - #### getStatistics

          public StatisticsBuilder getStatistics()

      Description copied from class: `DataHandle`
      Returns an object providing access to basic descriptive statistics about the data represented by this handle.
      Specified by:
        `getStatistics` in class `DataHandle`
      Returns:
        the statistics

    - #### getValue

          public java.lang.String getValue(int row,
                                  int column)

      Description copied from class: `DataHandle`
      Returns the value in the specified cell.
      Specified by:
        `getValue` in class `DataHandle`
      Parameters:
        `row` - The cell's row index
        `column` - The cell's column index
      Returns:
        the value

    - #### isOutlier

          public boolean isOutlier(int row)

      Description copied from class: `DataHandle`
      Determines whether a given row is an outlier in the currently associated data transformation.
      Overrides:
        `isOutlier` in class `DataHandle`
      Parameters:
        `row` - the row
      Returns:
        true, if is outlier

    - #### iterator

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

      Description copied from class: `DataHandle`
      Returns an iterator over the data.
      Specified by:
        `iterator` in class `DataHandle`
      Returns:
        the iterator

    - #### doRelease

          protected void doRelease()

      Releases all resources.
      Specified by:
        `doRelease` in class `DataHandle`

    - #### getBaseDataType

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

      Description copied from class: `DataHandle`
      Returns the base data type without generalization.
      Overrides:
        `getBaseDataType` in class `DataHandle`
      Parameters:
        `attribute` - the attribute
      Returns:
        the base data type

    - #### getConfiguration

          protected ARXConfiguration getConfiguration()

      Description copied from class: `DataHandle`
      Returns the ARXConfiguration that is currently being used, null if this is an input handle
      Specified by:
        `getConfiguration` in class `DataHandle`
      Returns:

    - #### getDataTypeArray

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

      Description copied from class: `DataHandle`
      Generates an array of data types.
      Specified by:
        `getDataTypeArray` in class `DataHandle`
      Returns:
        the data type array

    - #### getDistinctValues

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

      Description copied from class: `DataHandle`
      Returns the distinct values.
      Specified by:
        `getDistinctValues` in class `DataHandle`
      Parameters:
        `column` - the column
        `handler` - the handler
      Returns:
        the distinct values

    - #### getInputBuffer

          protected int[][] getInputBuffer()

      Returns the input buffer
      Returns:

    - #### internalGetValue

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

      Description copied from class: `DataHandle`
      Internal representation of get value.
      Specified by:
        `internalGetValue` in class `DataHandle`
      Parameters:
        `row` - the row
        `column` - the col
      Returns:
        the string

    - #### internalReplace

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

      Description copied from class: `DataHandle`
      Internal replacement method.
      Specified by:
        `internalReplace` in class `DataHandle`
      Parameters:
        `column` - the column
        `original` - the original
        `replacement` - the replacement
      Returns:
        true, if successful

    - #### internalSwap

          protected void internalSwap(int row1,
                          int row2)

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

    - #### isLocked

          protected boolean isLocked()

      Is this handle locked?.
      Returns:

    - #### setDefinition

          protected void setDefinition(DataDefinition definition)

      Overrides the handles data definition.
      Parameters:
        `definition` -

    - #### setLocked

          protected void setLocked(boolean locked)

      Lock/unlock this handle.
      Parameters:
        `locked` -

    - #### update

          protected void update(Data data)

      Update the definition.
      Parameters:
        `data` -

    - #### update

          protected void update(int[][] dataGH,
                    int[][] dataDI,
                    int[][] dataIS)

      Updates the definition with further data to swap.
      Parameters:
        `dataGH` -
        `dataDI` -
        `dataIS` -