From 9f2ffecdf146a9def7bc90e877e1d69fa53fd022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Fri, 22 Nov 2019 18:07:36 +0100 Subject: Enhance naming and add comments --- .../pl/edu/mimuw/cloudatlas/client/ClientController.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/pl/edu/mimuw') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java index a4a9097..e40484e 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java @@ -8,11 +8,9 @@ import org.springframework.stereotype.Controller; import pl.edu.mimuw.cloudatlas.api.Api; import pl.edu.mimuw.cloudatlas.model.*; -import java.lang.reflect.Array; import java.net.InetAddress; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; -import java.time.format.DateTimeFormatter; import java.util.*; /* @@ -257,7 +255,7 @@ public class ClientController { } } - private ArrayList getNumericalValues(AttributesMap attribs) { + private ArrayList getNumericalAttributeValue(AttributesMap attribs) { Value val; Type valType; ArrayList valuesList = new ArrayList<>(); @@ -296,7 +294,7 @@ public class ClientController { return attribsMap.get(attribsMap.size() - 1).getValue(); } - private ArrayList getChartColumnNames() { + private ArrayList getNumericalColumnNames() { ArrayList chartValueNames = new ArrayList<>(); AttributesMap lastAttribMap = getLastAttributesMap(); @@ -309,14 +307,16 @@ public class ClientController { return chartValueNames; } + // data format compatible with Google Line Chart + // https://developers.google.com/chart/interactive/docs/gallery/linechart private ArrayList getNumericalValuesTable() { ArrayList chartValues = new ArrayList<>(); - ArrayList chartValueNames = getChartColumnNames(); + ArrayList chartValueNames = getNumericalColumnNames(); ArrayList chartValueColumn; System.out.println(this.attributes); for (Map.Entry attribsMap : this.attributes.entrySet()) { - chartValueColumn = getNumericalValues(attribsMap.getValue()); + chartValueColumn = getNumericalAttributeValue(attribsMap.getValue()); chartValueColumn.add(0, attribsMap.getKey().toString().substring(11, 19)); while (chartValueColumn.size() < chartValueNames.size()) { chartValueColumn.add(null); -- cgit v1.2.3