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:
parent
9d7b8a5279
commit
bde63ff417
@ -62,11 +62,11 @@ public class Cross implements Function {
|
||||
toColumnName != null && toColumnName instanceof String) {
|
||||
|
||||
ProjectJoin join = ProjectManager.singleton.getInterProjectModel().getJoin(
|
||||
ProjectManager.singleton.getProjectMetadata(
|
||||
((Project) bindings.get("project")).id).getName(),
|
||||
((WrappedCell) wrappedCell).columnName,
|
||||
(String) toProjectName,
|
||||
(String) toColumnName
|
||||
ProjectManager.singleton.getProjectMetadata(
|
||||
((Project) bindings.get("project")).id).getName(),
|
||||
((WrappedCell) wrappedCell).columnName,
|
||||
(String) toProjectName,
|
||||
(String) toColumnName
|
||||
);
|
||||
|
||||
return join.getRows(((WrappedCell) wrappedCell).cell.value);
|
||||
|
@ -54,10 +54,10 @@ public class ToString implements Function {
|
||||
if (o1 instanceof Calendar || o1 instanceof Date) {
|
||||
DateFormat formatter = null;
|
||||
if (args.length == 2) {
|
||||
Object o2 = args[1];
|
||||
if (o2 != null && o2 instanceof String) {
|
||||
formatter = new SimpleDateFormat((String) o2);
|
||||
}
|
||||
Object o2 = args[1];
|
||||
if (o2 != null && o2 instanceof String) {
|
||||
formatter = new SimpleDateFormat((String) o2);
|
||||
}
|
||||
}
|
||||
if (formatter == null) {
|
||||
formatter = DateFormat.getDateInstance();
|
||||
|
@ -140,22 +140,22 @@ public class ProjectUtilities {
|
||||
static protected Project loadFromFile(
|
||||
File file,
|
||||
long id
|
||||
) throws Exception {
|
||||
ZipFile zipFile = new ZipFile(file);
|
||||
try {
|
||||
Pool pool = new Pool();
|
||||
ZipEntry poolEntry = zipFile.getEntry("pool.txt");
|
||||
if (poolEntry != null) {
|
||||
pool.load(zipFile.getInputStream(poolEntry));
|
||||
} // else, it's a legacy project file
|
||||
) throws Exception {
|
||||
ZipFile zipFile = new ZipFile(file);
|
||||
try {
|
||||
Pool pool = new Pool();
|
||||
ZipEntry poolEntry = zipFile.getEntry("pool.txt");
|
||||
if (poolEntry != null) {
|
||||
pool.load(zipFile.getInputStream(poolEntry));
|
||||
} // else, it's a legacy project file
|
||||
|
||||
return Project.loadFromInputStream(
|
||||
return Project.loadFromInputStream(
|
||||
zipFile.getInputStream(zipFile.getEntry("data.txt")),
|
||||
id,
|
||||
pool
|
||||
);
|
||||
} finally {
|
||||
zipFile.close();
|
||||
}
|
||||
);
|
||||
} finally {
|
||||
zipFile.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -78,18 +78,18 @@ public class MultiValuedCellSplitOperation extends AbstractOperation {
|
||||
_mode = mode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
|
||||
writer.object();
|
||||
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("columnName"); writer.value(_columnName);
|
||||
writer.key("keyColumnName"); writer.value(_keyColumnName);
|
||||
writer.key("separator"); writer.value(_separator);
|
||||
writer.key("mode"); writer.value(_mode);
|
||||
writer.endObject();
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
|
||||
writer.object();
|
||||
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("columnName"); writer.value(_columnName);
|
||||
writer.key("keyColumnName"); writer.value(_keyColumnName);
|
||||
writer.key("separator"); writer.value(_separator);
|
||||
writer.key("mode"); writer.value(_mode);
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -85,20 +85,20 @@ public class TransposeColumnsIntoRowsOperation extends AbstractOperation {
|
||||
_ignoreBlankCells = ignoreBlankCells;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
|
||||
writer.object();
|
||||
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("startColumnName"); writer.value(_startColumnName);
|
||||
writer.key("columnCount"); writer.value(_columnCount);
|
||||
writer.key("combinedColumnName"); writer.value(_combinedColumnName);
|
||||
writer.key("prependColumnName"); writer.value(_prependColumnName);
|
||||
writer.key("separator"); writer.value(_separator);
|
||||
writer.key("ignoreBlankCells"); writer.value(_ignoreBlankCells);
|
||||
writer.endObject();
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
|
||||
writer.object();
|
||||
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("startColumnName"); writer.value(_startColumnName);
|
||||
writer.key("columnCount"); writer.value(_columnCount);
|
||||
writer.key("combinedColumnName"); writer.value(_combinedColumnName);
|
||||
writer.key("prependColumnName"); writer.value(_prependColumnName);
|
||||
writer.key("separator"); writer.value(_separator);
|
||||
writer.key("ignoreBlankCells"); writer.value(_ignoreBlankCells);
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -69,16 +69,16 @@ public class TransposeRowsIntoColumnsOperation extends AbstractOperation {
|
||||
_rowCount = rowCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
|
||||
writer.object();
|
||||
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("columnName"); writer.value(_columnName);
|
||||
writer.key("rowCount"); writer.value(_rowCount);
|
||||
writer.endObject();
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
|
||||
writer.object();
|
||||
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("columnName"); writer.value(_columnName);
|
||||
writer.key("rowCount"); writer.value(_rowCount);
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -65,16 +65,16 @@ public class ColumnMoveOperation extends AbstractOperation {
|
||||
_index = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
|
||||
writer.object();
|
||||
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
|
||||
writer.key("description"); writer.value("Move column " + _columnName + " to position " + _index);
|
||||
writer.key("columnName"); writer.value(_columnName);
|
||||
writer.key("index"); writer.value(_index);
|
||||
writer.endObject();
|
||||
writer.object();
|
||||
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
|
||||
writer.key("description"); writer.value("Move column " + _columnName + " to position " + _index);
|
||||
writer.key("columnName"); writer.value(_columnName);
|
||||
writer.key("index"); writer.value(_index);
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
|
||||
|
@ -62,15 +62,15 @@ public class ColumnRemovalOperation extends AbstractOperation {
|
||||
_columnName = columnName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
|
||||
writer.object();
|
||||
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
|
||||
writer.key("description"); writer.value("Remove column " + _columnName);
|
||||
writer.key("columnName"); writer.value(_columnName);
|
||||
writer.endObject();
|
||||
writer.object();
|
||||
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
|
||||
writer.key("description"); writer.value("Remove column " + _columnName);
|
||||
writer.key("columnName"); writer.value(_columnName);
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
|
||||
|
@ -65,16 +65,16 @@ public class ColumnRenameOperation extends AbstractOperation {
|
||||
_newColumnName = newColumnName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
|
||||
writer.object();
|
||||
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
|
||||
writer.key("description"); writer.value("Rename column " + _oldColumnName + " to " + _newColumnName);
|
||||
writer.key("oldColumnName"); writer.value(_oldColumnName);
|
||||
writer.key("newColumnName"); writer.value(_newColumnName);
|
||||
writer.endObject();
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
|
||||
writer.object();
|
||||
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
|
||||
writer.key("description"); writer.value("Rename column " + _oldColumnName + " to " + _newColumnName);
|
||||
writer.key("oldColumnName"); writer.value(_oldColumnName);
|
||||
writer.key("newColumnName"); writer.value(_newColumnName);
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
|
||||
|
@ -59,14 +59,14 @@ public class DenormalizeOperation extends AbstractOperation {
|
||||
public DenormalizeOperation() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
|
||||
writer.object();
|
||||
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
|
||||
writer.key("description"); writer.value("Denormalize");
|
||||
writer.endObject();
|
||||
@Override
|
||||
public void write(JSONWriter writer, Properties options)
|
||||
throws JSONException {
|
||||
|
||||
writer.object();
|
||||
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
|
||||
writer.key("description"); writer.value("Denormalize");
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,11 +89,11 @@ public class RowReorderOperation extends AbstractOperation {
|
||||
return "Reorder rows";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception {
|
||||
@Override
|
||||
protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception {
|
||||
Engine engine = new Engine(project);
|
||||
engine.setMode(_mode);
|
||||
|
||||
|
||||
List<Integer> rowIndices = new ArrayList<Integer>();
|
||||
if (_mode == Mode.RowBased) {
|
||||
RowVisitor visitor = new IndexingVisitor(rowIndices);
|
||||
@ -117,10 +117,10 @@ protected HistoryEntry createHistoryEntry(Project project, long historyEntryID)
|
||||
visitor = srv;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
engine.getAllRecords().accept(project, visitor);
|
||||
}
|
||||
|
||||
|
||||
return new HistoryEntry(
|
||||
historyEntryID,
|
||||
project,
|
||||
@ -128,35 +128,35 @@ protected HistoryEntry createHistoryEntry(Project project, long historyEntryID)
|
||||
this,
|
||||
new RowReorderChange(rowIndices)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static protected class IndexingVisitor implements RowVisitor, RecordVisitor {
|
||||
List<Integer> _indices;
|
||||
static protected class IndexingVisitor implements RowVisitor, RecordVisitor {
|
||||
List<Integer> _indices;
|
||||
|
||||
IndexingVisitor(List<Integer> indices) {
|
||||
_indices = indices;
|
||||
}
|
||||
IndexingVisitor(List<Integer> indices) {
|
||||
_indices = indices;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Project project) {
|
||||
}
|
||||
@Override
|
||||
public void start(Project project) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void end(Project project) {
|
||||
}
|
||||
@Override
|
||||
public void end(Project project) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(Project project, int rowIndex, Row row) {
|
||||
_indices.add(rowIndex);
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean visit(Project project, int rowIndex, Row row) {
|
||||
_indices.add(rowIndex);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(Project project, Record record) {
|
||||
for (int r = record.fromRowIndex; r < record.toRowIndex; r++) {
|
||||
_indices.add(r);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean visit(Project project, Record record) {
|
||||
for (int r = record.fromRowIndex; r < record.toRowIndex; r++) {
|
||||
_indices.add(r);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -474,10 +474,10 @@ class RefineClient extends JFrame implements ActionListener {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
String item = e.getActionCommand();
|
||||
if (item.startsWith("Open")) {
|
||||
openBrowser();
|
||||
}
|
||||
String item = e.getActionCommand();
|
||||
if (item.startsWith("Open")) {
|
||||
openBrowser();
|
||||
}
|
||||
}
|
||||
|
||||
private void openBrowser() {
|
||||
|
Loading…
Reference in New Issue
Block a user