Skip to content

Commit

Permalink
Reformat Concatenate
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Apr 11, 2022
1 parent 4fea088 commit 330b40e
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package org.enso.table.aggregations;

import javax.swing.JSeparator;
import java.util.List;
import org.enso.table.data.column.storage.Storage;
import org.enso.table.data.table.Column;
import org.enso.table.data.table.problems.InvalidAggregation;
import org.enso.table.data.table.problems.UnquotedDelimiter;

import java.util.List;

public class Concatenate extends Aggregator {
private final Storage storage;
private final String separator;
private final String prefix;
private final String suffix;
private final String quote;

public Concatenate(String name, Column column, String separator, String prefix, String suffix, String quote) {
public Concatenate(
String name, Column column, String separator, String prefix, String suffix, String quote) {
super(name, Storage.Type.STRING);
this.storage = column.getStorage();

Expand All @@ -28,7 +27,7 @@ public Concatenate(String name, Column column, String separator, String prefix,
@Override
public Object aggregate(List<Integer> indexes) {
StringBuilder current = null;
for (int row: indexes) {
for (int row : indexes) {
Object value = storage.getItemBoxed(row);
if (value == null || value instanceof String) {
String textValue = toQuotedString(value, quote, separator);
Expand All @@ -54,7 +53,9 @@ public Object aggregate(List<Integer> indexes) {
return null;
}

if (prefix != null) { current.insert(0, prefix); }
if (prefix != null) {
current.insert(0, prefix);
}
current.append(suffix);
return current.toString();
}
Expand Down

0 comments on commit 330b40e

Please sign in to comment.