From 42eef2f0804100728451afcc085f0940cbbc44c4 Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Sun, 17 Nov 2019 11:29:05 +0100 Subject: Cleanup whitespace --- .../mimuw/cloudatlas/interpreter/ResultColumn.java | 124 ++++++++++----------- 1 file changed, 62 insertions(+), 62 deletions(-) (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/interpreter/ResultColumn.java') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/interpreter/ResultColumn.java b/src/main/java/pl/edu/mimuw/cloudatlas/interpreter/ResultColumn.java index a0d5ecd..b551955 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/interpreter/ResultColumn.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/interpreter/ResultColumn.java @@ -12,20 +12,20 @@ import pl.edu.mimuw.cloudatlas.model.ValueList; class ResultColumn extends Result { private final List column; - public ResultColumn(List column) { - this.column = column; - } + public ResultColumn(List column) { + this.column = column; + } @Override - protected ResultColumn binaryOperationTyped(BinaryOperation operation, ResultSingle right) { + protected ResultColumn binaryOperationTyped(BinaryOperation operation, ResultSingle right) { List results = new ArrayList(); for (Value value : column) { results.add(operation.perform(value, right.getValue())); } - return new ResultColumn(results); - } + return new ResultColumn(results); + } protected ResultColumn binaryOperationTyped(BinaryOperation operation, ResultColumn right) { List results = new ArrayList(); @@ -34,72 +34,72 @@ class ResultColumn extends Result { results.add(operation.perform(column.get(i), right.column.get(i))); } - return new ResultColumn(results); + return new ResultColumn(results); } - @Override - public ResultColumn unaryOperation(UnaryOperation operation) { + @Override + public ResultColumn unaryOperation(UnaryOperation operation) { List results = new ArrayList(); for (Value value : column) { results.add(operation.perform(value)); } - return new ResultColumn(results); - } - - @Override - protected Result callMe(BinaryOperation operation, Result left) { - return left.binaryOperationTyped(operation, this); - } - - @Override - public Value getValue() { - throw new UnsupportedOperationException("Not a ResultSingle."); - } - - @Override - public ValueList getList() { - throw new UnsupportedOperationException("Not a ResultList."); - } - - @Override - public ValueList getColumn() { + return new ResultColumn(results); + } + + @Override + protected Result callMe(BinaryOperation operation, Result left) { + return left.binaryOperationTyped(operation, this); + } + + @Override + public Value getValue() { + throw new UnsupportedOperationException("Not a ResultSingle."); + } + + @Override + public ValueList getList() { + throw new UnsupportedOperationException("Not a ResultList."); + } + + @Override + public ValueList getColumn() { return new ValueList(column, TypeCollection.computeElementType(column)); - } + } @Override - public ResultSingle aggregationOperation(AggregationOperation operation) { + public ResultSingle aggregationOperation(AggregationOperation operation) { return new ResultSingle(operation.perform(getColumn())); - } + } @Override - public Result transformOperation(TransformOperation operation) { + public Result transformOperation(TransformOperation operation) { // TODO: this should be a ResultList - return new ResultColumn(operation.perform(getColumn())); - } + return new ResultColumn(operation.perform(getColumn())); + } - @Override - public Result filterNulls() { - throw new UnsupportedOperationException("Operation filterNulls not supported yet."); - } + @Override + public Result filterNulls() { + throw new UnsupportedOperationException("Operation filterNulls not supported yet."); + } - @Override - public Result first(int size) { + @Override + public Result first(int size) { List subList = column.subList(0, Math.min(size, column.size())); return new ResultSingle(new ValueList(subList, TypeCollection.computeElementType(subList))); - } + } - @Override - public Result last(int size) { + @Override + public Result last(int size) { List subList = column.subList( Math.max(0, column.size() - size), column.size() ); return new ResultSingle(new ValueList(subList, TypeCollection.computeElementType(subList))); - } + } - @Override - public Result random(int size) { + @Override + public Result random(int size) { return new ResultColumn( randomList( new ValueList( @@ -109,28 +109,28 @@ class ResultColumn extends Result { size ) ); - } + } - @Override - public ResultColumn convertTo(Type to) { + @Override + public ResultColumn convertTo(Type to) { List results = new ArrayList(); for (Value value : column) { results.add(value.convertTo(to)); } - return new ResultColumn(results); - } + return new ResultColumn(results); + } - @Override - public ResultSingle isNull() { - throw new UnsupportedOperationException("Operation isNull not supported yet."); - // return new ResultSingle(new ValueBoolean(value.isNull())); - } + @Override + public ResultSingle isNull() { + throw new UnsupportedOperationException("Operation isNull not supported yet."); + // return new ResultSingle(new ValueBoolean(value.isNull())); + } - @Override - public Type getType() { - throw new UnsupportedOperationException("Operation getType not supported yet."); - // return value.getType(); - } + @Override + public Type getType() { + throw new UnsupportedOperationException("Operation getType not supported yet."); + // return value.getType(); + } } -- cgit v1.2.3