Klasse DataHandleSubset

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

public class DataHandleSubset extends DataHandle
This implementation of a data handle projects a given data handle onto a given research subset.
  • Konstruktordetails

    • DataHandleSubset

      public DataHandleSubset(DataHandle source, DataSubset subset)
      Creates a new handle that represents the research subset.
      Parameter:
      source -
      subset -
  • Methodendetails

    • getAttributeName

      public String getAttributeName(int col)
      Beschreibung aus Klasse kopiert: DataHandle
      Returns the name of the specified column.
      Angegeben von:
      getAttributeName in Klasse DataHandle
      Parameter:
      col - The column index
      Gibt zurück:
      the attribute name
    • getDataType

      public DataType<?> getDataType(String attribute)
      Beschreibung aus Klasse kopiert: DataHandle
      Returns the according data type.
      Setzt außer Kraft:
      getDataType in Klasse DataHandle
      Parameter:
      attribute - the attribute
      Gibt zurück:
      the data type
    • getGeneralization

      public int getGeneralization(String attribute)
      Beschreibung aus Klasse kopiert: DataHandle
      Returns the generalization level for the attribute.
      Angegeben von:
      getGeneralization in Klasse DataHandle
      Parameter:
      attribute - the attribute
      Gibt zurück:
      the generalization
    • getNumColumns

      public int getNumColumns()
      Beschreibung aus Klasse kopiert: DataHandle
      Returns the number of columns in the dataset.
      Angegeben von:
      getNumColumns in Klasse DataHandle
      Gibt zurück:
      the num columns
    • getNumRows

      public int getNumRows()
      Beschreibung aus Klasse kopiert: DataHandle
      Returns the number of rows in the dataset.
      Angegeben von:
      getNumRows in Klasse DataHandle
      Gibt zurück:
      the num rows
    • getStatistics

      public StatisticsBuilder getStatistics()
      Beschreibung aus Klasse kopiert: DataHandle
      Returns an object providing access to basic descriptive statistics about the data represented by this handle.
      Angegeben von:
      getStatistics in Klasse DataHandle
      Gibt zurück:
      the statistics
    • getSubset

      public DataSubset getSubset()
      Returns the research subset.
      Gibt zurück:
    • getValue

      public String getValue(int row, int col)
      Beschreibung aus Klasse kopiert: DataHandle
      Returns the value in the specified cell.
      Angegeben von:
      getValue in Klasse DataHandle
      Parameter:
      row - The cell's row index
      col - The cell's column index
      Gibt zurück:
      the value
    • getView

      public DataHandle getView()
      Beschreibung aus Klasse kopiert: DataHandle
      Returns a new data handle that represents a context specific view on the dataset.
      Setzt außer Kraft:
      getView in Klasse DataHandle
      Gibt zurück:
      the view
    • isOptimized

      public boolean isOptimized()
      Beschreibung aus Klasse kopiert: DataHandle
      Has this handle been optimized with local recoding?
      Setzt außer Kraft:
      isOptimized in Klasse DataHandle
      Gibt zurück:
    • isOutlier

      public boolean isOutlier(int row)
      Beschreibung aus Klasse kopiert: DataHandle
      Determines whether a given row is an outlier in the currently associated data transformation.
      Setzt außer Kraft:
      isOutlier in Klasse DataHandle
      Parameter:
      row - the row
      Gibt zurück:
      true, if is outlier
    • iterator

      public Iterator<String[]> iterator()
      Beschreibung aus Klasse kopiert: DataHandle
      Returns an iterator over the data.
      Angegeben von:
      iterator in Klasse DataHandle
      Gibt zurück:
      the iterator
    • replace

      public boolean replace(int column, String original, String replacement)
      Beschreibung aus Klasse kopiert: DataHandle
      Replaces the original value with the replacement in the given column. Only supported by handles for input data.
      Setzt außer Kraft:
      replace in Klasse DataHandle
      Parameter:
      column - the column
      original - the original
      replacement - the replacement
      Gibt zurück:
      Whether the original value was found
    • shuffledIterator

      public Iterator<String[]> shuffledIterator()
      Beschreibung aus Klasse kopiert: DataHandle
      Returns an iterator over the data in a random order.
      Angegeben von:
      shuffledIterator in Klasse DataHandle
      Gibt zurück:
      the iterator
    • doRelease

      protected void doRelease()
      Beschreibung aus Klasse kopiert: DataHandle
      Releases all resources.
      Angegeben von:
      doRelease in Klasse DataHandle
    • getColumnToDataType

      protected DataType<?>[] getColumnToDataType()
      Beschreibung aus Klasse kopiert: DataHandle
      Generates an array of data types.
      Angegeben von:
      getColumnToDataType in Klasse DataHandle
      Gibt zurück:
      the data type array
    • getConfiguration

      protected ARXConfiguration getConfiguration()
      Beschreibung aus Klasse kopiert: DataHandle
      Returns the ARXConfiguration that is currently being used, null if this is an input handle
      Angegeben von:
      getConfiguration in Klasse DataHandle
      Gibt zurück:
    • getDistinctValues

      protected String[] getDistinctValues(int column, boolean ignoreSuppression, DataHandleInternal.InterruptHandler handler)
      Beschreibung aus Klasse kopiert: DataHandle
      Returns the distinct values.
      Angegeben von:
      getDistinctValues in Klasse DataHandle
      Parameter:
      column - the column
      ignoreSuppression -
      handler - the handler
      Gibt zurück:
      the distinct values
    • getSource

      protected DataHandle getSource()
      Returns the underlying source data handle.
      Gibt zurück:
    • getValueIdentifier

      protected int getValueIdentifier(int column, String value)
      Beschreibung aus Klasse kopiert: DataHandle
      Returns the internal value identifier
      Angegeben von:
      getValueIdentifier in Klasse DataHandle
      Parameter:
      column -
      value -
      Gibt zurück:
    • internalCompare

      protected int internalCompare(int row1, int row2, int[] columns, boolean ascending)
      Beschreibung aus Klasse kopiert: DataHandle
      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.
      Setzt außer Kraft:
      internalCompare in Klasse DataHandle
      Parameter:
      row1 - the row1
      row2 - the row2
      columns - the columns
      ascending - the ascending
      Gibt zurück:
      the int
    • internalGetEncodedValue

      protected int internalGetEncodedValue(int row, int col, boolean ignoreSuppression)
      Beschreibung aus Klasse kopiert: DataHandle
      Internal representation of get encoded value. Returns -1 for suppressed values.
      Angegeben von:
      internalGetEncodedValue in Klasse DataHandle
      Parameter:
      row - the row
      col - the col
      Gibt zurück:
      the value
    • internalGetValue

      protected String internalGetValue(int row, int col, boolean ignoreSuppression)
      Beschreibung aus Klasse kopiert: DataHandle
      Internal representation of get value.
      Angegeben von:
      internalGetValue in Klasse DataHandle
      Parameter:
      row - the row
      col - the col
      Gibt zurück:
      the string
    • internalIsOutlier

      protected boolean internalIsOutlier(int row, int[] columns)
      Beschreibung aus Klasse kopiert: DataHandle
      Returns whether this is an outlier regarding the given columns. If no columns have been specified, true will be returned.
      Angegeben von:
      internalIsOutlier in Klasse DataHandle
      Parameter:
      row -
      columns -
      Gibt zurück:
    • internalRebuild

      protected void internalRebuild()
      Rebuild array representation of subset.
    • internalReplace

      protected boolean internalReplace(int column, String original, String replacement)
      Beschreibung aus Klasse kopiert: DataHandle
      Internal replacement method.
      Angegeben von:
      internalReplace in Klasse DataHandle
      Parameter:
      column - the column
      original - the original
      replacement - the replacement
      Gibt zurück:
      true, if successful
    • internalSwap

      protected void internalSwap(int row1, int row2)
      Swaps the bits in the set representation.
      Parameter:
      row1 -
      row2 -
    • internalTranslate

      protected int internalTranslate(int row)
      Translates the row number.
      Parameter:
      row -
      Gibt zurück:
    • isAnonymous

      protected boolean isAnonymous()
      Beschreibung aus Klasse kopiert: DataHandle
      Returns whether the data represented by this handle is anonymous
      Setzt außer Kraft:
      isAnonymous in Klasse DataHandle
      Gibt zurück: