Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
DataCleaner (community edition) Copyright (C) 2014 Neopost - Customer Information Management This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions of the GNU Lesser General Public License, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this distribution; if not, write to: Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA
 
 package org.datacleaner.beans.dategap;
 
 import java.util.Map;
 import java.util.Set;
 
 
 public class DateGapAnalyzerResult implements AnalyzerResult {
 
     private static final long serialVersionUID = 1L;
 
     private final String _fromColumnName;
     private final String _toColumnName;
     private final String _groupColumnName;
     private final Map<StringSortedSet<TimeInterval>> _gaps;
     private final Map<StringSortedSet<TimeInterval>> _overlaps;
     private final Map<StringTimeInterval_completeDurations;
 
     public DateGapAnalyzerResult(String fromColumnNameString toColumnNameString groupColumnName,
             Map<StringTimeIntervalcompleteIntervalsMap<StringSortedSet<TimeInterval>> gaps,
             Map<StringSortedSet<TimeInterval>> overlaps) {
          = fromColumnName;
          = toColumnName;
          = groupColumnName;
 
          = (completeIntervals == null ? Collections.<StringTimeIntervalemptyMap()
                 : completeIntervals);
          = (gaps == null ? Collections.<StringSortedSet<TimeInterval>> emptyMap() : gaps);
          = (overlaps == null ? Collections.<StringSortedSet<TimeInterval>> emptyMap() : overlaps);
     }

    

Returns:
the names of the recorded groups of records that have gaps and/or overlaps
 
     public Set<StringgetGroupNames() {
         return .keySet();
     }
 
     @Metric("Total date gap count")
     public int getTotalGapCount() {
         int count = 0;
         Collection<SortedSet<TimeInterval>> gapSets = .values();
         for (SortedSet<TimeIntervalgapSet : gapSets) {
             count += gapSet.size();
         }
         return count;
     }
 
     @Metric("Date gap count")
     public ParameterizableMetric getGapCount() {
         return new ParameterizableMetric() {
             @Override
             public Number getValue(String parameter) {
                 SortedSet<TimeIntervalgapSet = .get(parameter);
                 if (gapSet == null) {
                     return 0;
                 }
                 return gapSet.size();
             }
 
             @Override
             public Collection<StringgetParameterSuggestions() {
                 return .keySet();
             }
         };
     }

    
Gets the complete duration/interval over which a group has been recorded. This duration will always include both gaps and overlaps.

Parameters:
groupName
Returns:
the complete duration (ie. first and last recorded date) of a group as a single interval.
    public TimeInterval getCompleteDuration(String groupName) {
        return .get(groupName);
    }

    

Parameters:
groupName
Returns:
the intervals that represents gaps in the complete duration
    public SortedSet<TimeIntervalgetGaps(String groupName) {
        return .get(groupName);
    }

    

Parameters:
groupName
Returns:
the intervals where there are overlapping entries in the complete duration
    public SortedSet<TimeIntervalgetOverlaps(String groupName) {
        return .get(groupName);
    }
    public String getFromColumnName() {
        return ;
    }
    public String getToColumnName() {
        return ;
    }
    public String getGroupColumnName() {
        return ;
    }
    @Override
    public String toString() {
        final SortedMap<StringSortedSet<TimeInterval>> gaps;
        if ( instanceof SortedMap) {
            gaps = (SortedMap<StringSortedSet<TimeInterval>>) ;
        } else {
            gaps = new TreeMap<>(NullTolerableComparator.get(String.class));
            gaps.putAll();
        }
        return "DateGapAnalyzerResult[gaps=" + gaps + "]";
    }
New to GrepCode? Check out our FAQ X