/*
 * ARX: Powerful Data Anonymization
 * Copyright 2012 - 2015 Florian Kohlmayer, Fabian Prasser
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.deidentifier.arx.examples;

import org.deidentifier.arx.Data;
import org.deidentifier.arx.Data.DefaultData;
import org.deidentifier.arx.DataType;

/**
 * This class implements an example of how to compute summary statistics
 *
 * @author Fabian Prasser
 * @author Florian Kohlmayer
 */
public class Example30 extends Example {

    /**
     * Entry point.
     * 
     * @param args
     *            the arguments
     */
    public static void main(final String[] args) {

        // Define data
        DefaultData data = Data.create();
        data.add("age", "gender", "zipcode", "date");
        data.add("45", "female", "81675", "01.01.1982");
        data.add("34", "male", "81667", "11.05.1982");
        data.add("66", "male", "81925", "31.08.1982");
        data.add("70", "female", "81931", "02.07.1982");
        data.add("34", "female", "81931", "05.01.1982");
        data.add("70", "male", "81931", "24.03.1982");
        data.add("45", "male", "81931", "23.11.1982");
        
        System.out.println(data.getHandle().getStatistics().getSummaryStatistics(true));
        
        data.getDefinition().setDataType("age", DataType.INTEGER);
        data.getDefinition().setDataType("zipcode", DataType.DECIMAL);
        data.getDefinition().setDataType("date", DataType.DATE);

        System.out.println(data.getHandle().getStatistics().getSummaryStatistics(true));
    }
}

@@ -1389,18 +1389,20 @@
 ta.add(%22
-66
+NULL
 %22, %22male
@@ -1514,31 +1514,28 @@
 , %22female%22, 
-%2281931%22
+null
 , %2205.01.198
@@ -1639,18 +1639,12 @@
 %22, %22
-23.11.1982
+NULL
 %22);%0A

Add some null values