troubleshooting Question

Need to display current day,previous day,last twodays data in my code using java

Avatar of srikotesh
srikotesh asked on
7 Comments1 Solution92 ViewsLast Modified:
Hi Experts,

i want to display list values based on now(current day),last day(current date+previous day),last two days.
List<PerformanceDataValues> dataList = new ArrayList<>();
                for (Entry<String, String> entry : treemap.entrySet()) {
                    PerformanceDataValues data = new PerformanceDataValues();
                    String value = entry.getValue();
                    String computedValue = applyFormula(value, wsdlInput.getFormulae());
                    data.setValue(computedValue != null ? computedValue : value);

this list will have values as below,
every time this list will have last 3 days data.
i want to display 3 different outputs

a) days as 0
i have to display current date---> time and values information

b) days as 1
i have to display current day and previous day

c) days as 3

last 3days data

in method parameter i am passing the input value for days.
MeasurementInput input
input.getDays() will give value as 0 or 1 or  2 based on the value i have to show any of the data

dataList sample values:
        "time": "2016-1-10 13:30:00",
        "value": 253.000
        "time": "2016-1-10 13:30:00",
        "value": 53.000
        "time": "2016-1-11 13:30:00",
        "value": 353.000
        "time": "2016-1-11 13:30:00",
        "value": 3.000
        "time": "2015-1-12 13:30:00",
        "value": 30.000
        "time": "2015-1-12 13:30:00",
        "value": 23.000

Sr. Software engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros