Class FineGrainedPrivacyMap
- java.lang.Object
- 
- org.apache.sysds.runtime.privacy.finegrained.FineGrainedPrivacyMap
 
- 
- All Implemented Interfaces:
- FineGrainedPrivacy
 
 public class FineGrainedPrivacyMap extends Object implements FineGrainedPrivacy Simple implementation of retrieving fine-grained privacy constraints based on iterating a LinkedHashMap.
- 
- 
Constructor SummaryConstructors Constructor Description FineGrainedPrivacyMap()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,long[][][]>getAllConstraints()Get all fine-grained constraints as a map from privacy level to an array of data ranges represented as two-dimensional long arrays.ArrayList<Map.Entry<DataRange,PrivacyConstraint.PrivacyLevel>>getAllConstraintsList()Return all fine-grained privacy constraints as an arraylist.PrivacyConstraint.PrivacyLevel[]getColPrivacy(int numRows, int numCols)DataRange[]getDataRangesOfPrivacyLevel(PrivacyConstraint.PrivacyLevel privacyLevel)Get all data ranges for the given privacy level.Map<DataRange,PrivacyConstraint.PrivacyLevel>getPrivacyLevel(DataRange searchRange)Get the data ranges and related privacy levels within given data search range.Map<DataRange,PrivacyConstraint.PrivacyLevel>getPrivacyLevelOfElement(long[] searchIndex)Get the data ranges and related privacy levels of the element with the given index.PrivacyConstraint.PrivacyLevel[]getRowPrivacy(int numRows, int numCols)booleanhasConstraints()True if any fine-grained constraints has been set.voidput(DataRange dataRange, PrivacyConstraint.PrivacyLevel privacyLevel)Set privacy level of the given data range.voidputCol(int colIndex, int colLength, PrivacyConstraint.PrivacyLevel privacyLevel)voidputElement(int rowIndex, int colIndex, PrivacyConstraint.PrivacyLevel privacyLevel)voidputRow(int rowIndex, int rowLength, PrivacyConstraint.PrivacyLevel privacyLevel)voidremoveAllConstraints()Remove all fine-grained privacy constraints.
 
- 
- 
- 
Method Detail- 
putpublic void put(DataRange dataRange, PrivacyConstraint.PrivacyLevel privacyLevel) Description copied from interface:FineGrainedPrivacySet privacy level of the given data range.- Specified by:
- putin interface- FineGrainedPrivacy
- Parameters:
- dataRange- representing the range for which the privacy is set
- privacyLevel- the level of privacy for the given data range
 
 - 
putRowpublic void putRow(int rowIndex, int rowLength, PrivacyConstraint.PrivacyLevel privacyLevel)- Specified by:
- putRowin interface- FineGrainedPrivacy
 
 - 
putColpublic void putCol(int colIndex, int colLength, PrivacyConstraint.PrivacyLevel privacyLevel)- Specified by:
- putColin interface- FineGrainedPrivacy
 
 - 
putElementpublic void putElement(int rowIndex, int colIndex, PrivacyConstraint.PrivacyLevel privacyLevel)- Specified by:
- putElementin interface- FineGrainedPrivacy
 
 - 
getPrivacyLevelpublic Map<DataRange,PrivacyConstraint.PrivacyLevel> getPrivacyLevel(DataRange searchRange) Description copied from interface:FineGrainedPrivacyGet the data ranges and related privacy levels within given data search range.- Specified by:
- getPrivacyLevelin interface- FineGrainedPrivacy
- Parameters:
- searchRange- the range from which all privacy levels are retrieved
- Returns:
- all mappings from range to privacy level within the given search range
 
 - 
getPrivacyLevelOfElementpublic Map<DataRange,PrivacyConstraint.PrivacyLevel> getPrivacyLevelOfElement(long[] searchIndex) Description copied from interface:FineGrainedPrivacyGet the data ranges and related privacy levels of the element with the given index.- Specified by:
- getPrivacyLevelOfElementin interface- FineGrainedPrivacy
- Parameters:
- searchIndex- index of element
- Returns:
- all mappings from range to privacy level for the given search element
 
 - 
getDataRangesOfPrivacyLevelpublic DataRange[] getDataRangesOfPrivacyLevel(PrivacyConstraint.PrivacyLevel privacyLevel) Description copied from interface:FineGrainedPrivacyGet all data ranges for the given privacy level.- Specified by:
- getDataRangesOfPrivacyLevelin interface- FineGrainedPrivacy
- Parameters:
- privacyLevel- for which data ranges are found
- Returns:
- all data ranges with the given privacy level
 
 - 
removeAllConstraintspublic void removeAllConstraints() Description copied from interface:FineGrainedPrivacyRemove all fine-grained privacy constraints.- Specified by:
- removeAllConstraintsin interface- FineGrainedPrivacy
 
 - 
hasConstraintspublic boolean hasConstraints() Description copied from interface:FineGrainedPrivacyTrue if any fine-grained constraints has been set.- Specified by:
- hasConstraintsin interface- FineGrainedPrivacy
- Returns:
- true if any fine-grained constraint is set
 
 - 
getAllConstraintspublic Map<String,long[][][]> getAllConstraints() Description copied from interface:FineGrainedPrivacyGet all fine-grained constraints as a map from privacy level to an array of data ranges represented as two-dimensional long arrays.- Specified by:
- getAllConstraintsin interface- FineGrainedPrivacy
- Returns:
- map from privacy level to array of data ranges
 
 - 
getAllConstraintsListpublic ArrayList<Map.Entry<DataRange,PrivacyConstraint.PrivacyLevel>> getAllConstraintsList() Description copied from interface:FineGrainedPrivacyReturn all fine-grained privacy constraints as an arraylist.- Specified by:
- getAllConstraintsListin interface- FineGrainedPrivacy
- Returns:
- all constraints
 
 - 
getRowPrivacypublic PrivacyConstraint.PrivacyLevel[] getRowPrivacy(int numRows, int numCols) - Specified by:
- getRowPrivacyin interface- FineGrainedPrivacy
 
 - 
getColPrivacypublic PrivacyConstraint.PrivacyLevel[] getColPrivacy(int numRows, int numCols) - Specified by:
- getColPrivacyin interface- FineGrainedPrivacy
 
 
- 
 
-