Last set of indentation cleanups - no functional changes

git-svn-id: http://google-refine.googlecode.com/svn/trunk@2211 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Tom Morris 2011-08-18 17:46:36 +00:00
parent 9d7b8a5279
commit bde63ff417
12 changed files with 126 additions and 126 deletions

View File

@ -62,11 +62,11 @@ public class Cross implements Function {
toColumnName != null && toColumnName instanceof String) { toColumnName != null && toColumnName instanceof String) {
ProjectJoin join = ProjectManager.singleton.getInterProjectModel().getJoin( ProjectJoin join = ProjectManager.singleton.getInterProjectModel().getJoin(
ProjectManager.singleton.getProjectMetadata( ProjectManager.singleton.getProjectMetadata(
((Project) bindings.get("project")).id).getName(), ((Project) bindings.get("project")).id).getName(),
((WrappedCell) wrappedCell).columnName, ((WrappedCell) wrappedCell).columnName,
(String) toProjectName, (String) toProjectName,
(String) toColumnName (String) toColumnName
); );
return join.getRows(((WrappedCell) wrappedCell).cell.value); return join.getRows(((WrappedCell) wrappedCell).cell.value);

View File

@ -54,10 +54,10 @@ public class ToString implements Function {
if (o1 instanceof Calendar || o1 instanceof Date) { if (o1 instanceof Calendar || o1 instanceof Date) {
DateFormat formatter = null; DateFormat formatter = null;
if (args.length == 2) { if (args.length == 2) {
Object o2 = args[1]; Object o2 = args[1];
if (o2 != null && o2 instanceof String) { if (o2 != null && o2 instanceof String) {
formatter = new SimpleDateFormat((String) o2); formatter = new SimpleDateFormat((String) o2);
} }
} }
if (formatter == null) { if (formatter == null) {
formatter = DateFormat.getDateInstance(); formatter = DateFormat.getDateInstance();

View File

@ -140,22 +140,22 @@ public class ProjectUtilities {
static protected Project loadFromFile( static protected Project loadFromFile(
File file, File file,
long id long id
) throws Exception { ) throws Exception {
ZipFile zipFile = new ZipFile(file); ZipFile zipFile = new ZipFile(file);
try { try {
Pool pool = new Pool(); Pool pool = new Pool();
ZipEntry poolEntry = zipFile.getEntry("pool.txt"); ZipEntry poolEntry = zipFile.getEntry("pool.txt");
if (poolEntry != null) { if (poolEntry != null) {
pool.load(zipFile.getInputStream(poolEntry)); pool.load(zipFile.getInputStream(poolEntry));
} // else, it's a legacy project file } // else, it's a legacy project file
return Project.loadFromInputStream( return Project.loadFromInputStream(
zipFile.getInputStream(zipFile.getEntry("data.txt")), zipFile.getInputStream(zipFile.getEntry("data.txt")),
id, id,
pool pool
); );
} finally { } finally {
zipFile.close(); zipFile.close();
}
} }
}
} }

View File

@ -78,18 +78,18 @@ public class MultiValuedCellSplitOperation extends AbstractOperation {
_mode = mode; _mode = mode;
} }
@Override @Override
public void write(JSONWriter writer, Properties options) public void write(JSONWriter writer, Properties options)
throws JSONException { throws JSONException {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value("Split multi-valued cells in column " + _columnName); writer.key("description"); writer.value("Split multi-valued cells in column " + _columnName);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.key("keyColumnName"); writer.value(_keyColumnName); writer.key("keyColumnName"); writer.value(_keyColumnName);
writer.key("separator"); writer.value(_separator); writer.key("separator"); writer.value(_separator);
writer.key("mode"); writer.value(_mode); writer.key("mode"); writer.value(_mode);
writer.endObject(); writer.endObject();
} }
@Override @Override

View File

@ -85,20 +85,20 @@ public class TransposeColumnsIntoRowsOperation extends AbstractOperation {
_ignoreBlankCells = ignoreBlankCells; _ignoreBlankCells = ignoreBlankCells;
} }
@Override @Override
public void write(JSONWriter writer, Properties options) public void write(JSONWriter writer, Properties options)
throws JSONException { throws JSONException {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value("Transpose cells in " + _columnCount + " column(s) starting with " + _startColumnName + " into rows"); writer.key("description"); writer.value("Transpose cells in " + _columnCount + " column(s) starting with " + _startColumnName + " into rows");
writer.key("startColumnName"); writer.value(_startColumnName); writer.key("startColumnName"); writer.value(_startColumnName);
writer.key("columnCount"); writer.value(_columnCount); writer.key("columnCount"); writer.value(_columnCount);
writer.key("combinedColumnName"); writer.value(_combinedColumnName); writer.key("combinedColumnName"); writer.value(_combinedColumnName);
writer.key("prependColumnName"); writer.value(_prependColumnName); writer.key("prependColumnName"); writer.value(_prependColumnName);
writer.key("separator"); writer.value(_separator); writer.key("separator"); writer.value(_separator);
writer.key("ignoreBlankCells"); writer.value(_ignoreBlankCells); writer.key("ignoreBlankCells"); writer.value(_ignoreBlankCells);
writer.endObject(); writer.endObject();
} }
@Override @Override

View File

@ -69,16 +69,16 @@ public class TransposeRowsIntoColumnsOperation extends AbstractOperation {
_rowCount = rowCount; _rowCount = rowCount;
} }
@Override @Override
public void write(JSONWriter writer, Properties options) public void write(JSONWriter writer, Properties options)
throws JSONException { throws JSONException {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value("Transpose every " + _rowCount + " cells in column " + _columnName + " into separate columns"); writer.key("description"); writer.value("Transpose every " + _rowCount + " cells in column " + _columnName + " into separate columns");
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.key("rowCount"); writer.value(_rowCount); writer.key("rowCount"); writer.value(_rowCount);
writer.endObject(); writer.endObject();
} }
@Override @Override

View File

@ -65,16 +65,16 @@ public class ColumnMoveOperation extends AbstractOperation {
_index = index; _index = index;
} }
@Override @Override
public void write(JSONWriter writer, Properties options) public void write(JSONWriter writer, Properties options)
throws JSONException { throws JSONException {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value("Move column " + _columnName + " to position " + _index); writer.key("description"); writer.value("Move column " + _columnName + " to position " + _index);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.key("index"); writer.value(_index); writer.key("index"); writer.value(_index);
writer.endObject(); writer.endObject();
} }

View File

@ -62,15 +62,15 @@ public class ColumnRemovalOperation extends AbstractOperation {
_columnName = columnName; _columnName = columnName;
} }
@Override @Override
public void write(JSONWriter writer, Properties options) public void write(JSONWriter writer, Properties options)
throws JSONException { throws JSONException {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value("Remove column " + _columnName); writer.key("description"); writer.value("Remove column " + _columnName);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.endObject(); writer.endObject();
} }

View File

@ -65,16 +65,16 @@ public class ColumnRenameOperation extends AbstractOperation {
_newColumnName = newColumnName; _newColumnName = newColumnName;
} }
@Override @Override
public void write(JSONWriter writer, Properties options) public void write(JSONWriter writer, Properties options)
throws JSONException { throws JSONException {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value("Rename column " + _oldColumnName + " to " + _newColumnName); writer.key("description"); writer.value("Rename column " + _oldColumnName + " to " + _newColumnName);
writer.key("oldColumnName"); writer.value(_oldColumnName); writer.key("oldColumnName"); writer.value(_oldColumnName);
writer.key("newColumnName"); writer.value(_newColumnName); writer.key("newColumnName"); writer.value(_newColumnName);
writer.endObject(); writer.endObject();
} }

View File

@ -59,14 +59,14 @@ public class DenormalizeOperation extends AbstractOperation {
public DenormalizeOperation() { public DenormalizeOperation() {
} }
@Override @Override
public void write(JSONWriter writer, Properties options) public void write(JSONWriter writer, Properties options)
throws JSONException { throws JSONException {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value("Denormalize"); writer.key("description"); writer.value("Denormalize");
writer.endObject(); writer.endObject();
} }

View File

@ -89,11 +89,11 @@ public class RowReorderOperation extends AbstractOperation {
return "Reorder rows"; return "Reorder rows";
} }
@Override @Override
protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception {
Engine engine = new Engine(project); Engine engine = new Engine(project);
engine.setMode(_mode); engine.setMode(_mode);
List<Integer> rowIndices = new ArrayList<Integer>(); List<Integer> rowIndices = new ArrayList<Integer>();
if (_mode == Mode.RowBased) { if (_mode == Mode.RowBased) {
RowVisitor visitor = new IndexingVisitor(rowIndices); RowVisitor visitor = new IndexingVisitor(rowIndices);
@ -117,10 +117,10 @@ protected HistoryEntry createHistoryEntry(Project project, long historyEntryID)
visitor = srv; visitor = srv;
} }
} }
engine.getAllRecords().accept(project, visitor); engine.getAllRecords().accept(project, visitor);
} }
return new HistoryEntry( return new HistoryEntry(
historyEntryID, historyEntryID,
project, project,
@ -128,35 +128,35 @@ protected HistoryEntry createHistoryEntry(Project project, long historyEntryID)
this, this,
new RowReorderChange(rowIndices) new RowReorderChange(rowIndices)
); );
} }
static protected class IndexingVisitor implements RowVisitor, RecordVisitor { static protected class IndexingVisitor implements RowVisitor, RecordVisitor {
List<Integer> _indices; List<Integer> _indices;
IndexingVisitor(List<Integer> indices) { IndexingVisitor(List<Integer> indices) {
_indices = indices; _indices = indices;
} }
@Override @Override
public void start(Project project) { public void start(Project project) {
} }
@Override @Override
public void end(Project project) { public void end(Project project) {
} }
@Override @Override
public boolean visit(Project project, int rowIndex, Row row) { public boolean visit(Project project, int rowIndex, Row row) {
_indices.add(rowIndex); _indices.add(rowIndex);
return false; return false;
} }
@Override @Override
public boolean visit(Project project, Record record) { public boolean visit(Project project, Record record) {
for (int r = record.fromRowIndex; r < record.toRowIndex; r++) { for (int r = record.fromRowIndex; r < record.toRowIndex; r++) {
_indices.add(r); _indices.add(r);
} }
return false; return false;
} }
} }
} }

View File

@ -474,10 +474,10 @@ class RefineClient extends JFrame implements ActionListener {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
String item = e.getActionCommand(); String item = e.getActionCommand();
if (item.startsWith("Open")) { if (item.startsWith("Open")) {
openBrowser(); openBrowser();
} }
} }
private void openBrowser() { private void openBrowser() {