Are TimeSeries sorted?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
JoshRountree
Posts: 14
Joined: Thu Mar 02, 2006 9:00 pm

Are TimeSeries sorted?

Post by JoshRountree » Thu Apr 27, 2006 2:01 pm

Is the List in the TimeSeries class always kept in sorted order, such that

Code: Select all

TimeSeries t; // already filled with times

RegularTimePeriod p = t.getTimePeriod(0);
RegularTimePeriod p1 = t.getTimePeriod(n-1);
RegularTimePeriod p2 = t.getTimePeriod(n);

if (p.getFirstMillisecond() <
    p1.getFirstMillisecond() <
    p2.getFirstMillisecond()) {
//Will this always be true, if the time periods are only a millisecond long?
}

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Apr 27, 2006 2:39 pm

Yes, that is correct.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

JoshRountree
Posts: 14
Joined: Thu Mar 02, 2006 9:00 pm

Post by JoshRountree » Thu Apr 27, 2006 4:39 pm

Awesome, thanks!

Locked