Add some toString() methods to help with debugging

git-svn-id: http://google-refine.googlecode.com/svn/trunk@1941 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Tom Morris 2010-11-29 06:24:50 +00:00
parent af20157532
commit 3a8f9306bd
3 changed files with 20 additions and 0 deletions

View File

@ -35,6 +35,7 @@ package com.google.refine.importers;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@ -42,6 +43,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -59,6 +61,10 @@ public abstract class TreeImportUtilities {
static protected class RecordElementCandidate {
String[] path;
int count;
public String toString() {
return Arrays.toString(path);
}
}
@ -88,6 +94,12 @@ public abstract class TreeImportUtilities {
nonBlankCount = Math.max(nonBlankCount, g.nonBlankCount);
}
}
public String toString() {
return String.format("name=%s, columns={%s}, subgroups={{%s}}",
name,StringUtils.join(columns.keySet(), ','),
StringUtils.join(subgroups.keySet(),','));
}
}
/**

View File

@ -153,4 +153,8 @@ public class Column implements Jsonizable {
return column;
}
public String toString() {
return _name;
}
}

View File

@ -106,4 +106,8 @@ public class ColumnGroup implements Jsonizable {
protected void internalInitialize() {
subgroups = new LinkedList<ColumnGroup>();
}
public String toString() {
return String.format("%d:%d:k=%d",startColumnIndex,columnSpan,keyColumnIndex);
}
}