diff options
author | Magdalena Grodzińska <mag.grodzinska@gmail.com> | 2019-11-22 18:07:36 +0100 |
---|---|---|
committer | Magdalena Grodzińska <mag.grodzinska@gmail.com> | 2019-11-22 18:07:36 +0100 |
commit | 9f2ffecdf146a9def7bc90e877e1d69fa53fd022 (patch) | |
tree | 7bc81ab37bc3a9901c5617e9d2f1e9f95bfbdbd4 /src/main | |
parent | 2ae058e3465b2ba2495c294b82c65de5d48eb7c4 (diff) |
Enhance naming and add comments
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java | 12 |
1 files changed, 6 insertions, 6 deletions
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<String> getChartColumnNames() { + private ArrayList<String> getNumericalColumnNames() { ArrayList<String> 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<ArrayList> getNumericalValuesTable() { ArrayList<ArrayList> chartValues = new ArrayList<>(); - ArrayList<String> chartValueNames = getChartColumnNames(); + ArrayList<String> chartValueNames = getNumericalColumnNames(); ArrayList chartValueColumn; System.out.println(this.attributes); for (Map.Entry<ValueTime, AttributesMap> 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); |