Created
November 8, 2020 07:38
-
-
Save IT-Berater/fc55dcc81d121425add615019cce4530 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.wenzlaff.ubidots; | |
import com.ubidots.Variable; | |
/** | |
* CSV Objekt für Variablen von Ubidots. | |
* | |
* @author Thomas Wenzlaff | |
* | |
*/ | |
public class CsvView { | |
private static final String TRENNER = ", "; | |
private Variable wert; | |
public CsvView(Variable v) { | |
this.wert = v; | |
} | |
public CsvView() { | |
wert = null; | |
} | |
@Override | |
public String toString() { | |
StringBuilder builder = new StringBuilder(); | |
if (wert != null) { | |
builder.append(wert.getName()); | |
builder.append(TRENNER); | |
builder.append(wert.getMean()); | |
builder.append(TRENNER); | |
builder.append(wert.getUnit()); | |
builder.append(TRENNER); | |
builder.append(wert.getMax()); | |
builder.append(TRENNER); | |
builder.append(wert.getMin()); | |
builder.append(TRENNER); | |
builder.append(wert.getSum()); | |
builder.append(TRENNER); | |
builder.append(wert.getVariance()); | |
builder.append(TRENNER); | |
builder.append(wert.getCount()); | |
builder.append(TRENNER); | |
} | |
return builder.toString(); | |
} | |
public String getTitel() { | |
return "Name, Mittelwert, Einheit, Max, Min, Summe, Varianz, Anzahl ,"; | |
} | |
public void setValue(Variable v) { | |
this.wert = v; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment