Package no.uib.jsparklines.data
Class ArrrayListDataPoints
java.lang.Object
no.uib.jsparklines.data.ArrrayListDataPoints
- All Implemented Interfaces:
Serializable
,Comparable<ArrrayListDataPoints>
public class ArrrayListDataPoints extends Object implements Comparable<ArrrayListDataPoints>, Serializable
Object storing data points for use in the
JSparklinesArrayListBarChartTableCellRenderer.
- Author:
- Harald Barsnes
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description ArrrayListDataPoints(ArrayList<Double> data, JSparklinesArrayListBarChartTableCellRenderer.ValueDisplayType valueDisplayType)
Create a new ArrrayListDataPoints. -
Method Summary
Modifier and Type Method Description int
compareTo(ArrrayListDataPoints o)
Compares based on the sum of the values in the data arrays.ArrayList<Double>
getData()
Returns the array list.JSparklinesArrayListBarChartTableCellRenderer.ValueDisplayType
getDataSortingType()
Returns the value sort (and display) type.double
getSum()
Return the sum of the values in the list.double
getSumExceptLast()
Return the sum of the values in the list.void
setData(ArrayList<Double> data)
Set the array list.void
setDataSortingType(JSparklinesArrayListBarChartTableCellRenderer.ValueDisplayType valueDisplayType)
Set the value sort (and display) type.String
toString()
Returns all the values as a comma separated string.
-
Constructor Details
-
ArrrayListDataPoints
public ArrrayListDataPoints(ArrayList<Double> data, JSparklinesArrayListBarChartTableCellRenderer.ValueDisplayType valueDisplayType)Create a new ArrrayListDataPoints.- Parameters:
data
- the datavalueDisplayType
- the way to sort (and display) the data
-
-
Method Details
-
getDataSortingType
Returns the value sort (and display) type.- Returns:
- the value sort (and display) type
-
setDataSortingType
public void setDataSortingType(JSparklinesArrayListBarChartTableCellRenderer.ValueDisplayType valueDisplayType)Set the value sort (and display) type.- Parameters:
valueDisplayType
- the way to sort (and display) the data
-
getData
Returns the array list.- Returns:
- the array list
-
setData
Set the array list.- Parameters:
data
- the array list
-
getSum
public double getSum()Return the sum of the values in the list.- Returns:
- the sum of the values in the list
-
getSumExceptLast
public double getSumExceptLast()Return the sum of the values in the list.- Returns:
- the sum of the values in the list
-
toString
Returns all the values as a comma separated string. Note that the values are rounded to two decimals. -
compareTo
Compares based on the sum of the values in the data arrays.- Specified by:
compareTo
in interfaceComparable<ArrrayListDataPoints>
-