JFreeChart: DynamicTimeSeries with period of n milliseconds

前端 未结 3 1181
栀梦
栀梦 2020-12-04 00:40

I\'m trying do define an interface in which I want to plot some values received by an external device. These values are received with a frequency that can be set through the

3条回答
  •  离开以前
    2020-12-04 01:02

    I think because you have this:

    public class MultipleOfMilliseconds extends Millisecond
    //                                          ^^^^^^^^^^^
    

    this is true:

    if(timeSample instanceof Millisecond)
    

    If you change the ordering of the tests you might have better luck:

    if(timeSample instanceof MultipleOfMillisecond)
      this.pointsInTime = new MultipleOfMillisecond[nMoments];
    else if (timeSample instanceof Millisecond)
      this.pointsInTime = new Millisecond[nMoments];
    

提交回复
热议问题