1.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/AbstractChart.scala Mon Nov 02 17:30:56 2009 +0800
1.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/AbstractChart.scala Mon Nov 02 19:50:46 2009 +0800
1.3 @@ -43,7 +43,7 @@
1.4 import org.aiotrade.lib.charting.view.pane.DatumPlane
1.5 import org.aiotrade.lib.charting.laf.LookFeel
1.6 import org.aiotrade.lib.charting.widget.AbstractWidget
1.7 -import scala.collection.mutable.ArrayBuffer
1.8 +import org.aiotrade.lib.util.collection.ArrayList
1.9
1.10
1.11 /**
1.12 @@ -85,7 +85,7 @@
1.13 import AbstractChart._
1.14 import Chart._
1.15
1.16 - private val markPoints = new ArrayBuffer[Point] // used to draw selected mark
1.17 + private val markPoints = new ArrayList[Point] // used to draw selected mark
1.18
1.19 /** Component that charts x-y based on */
1.20 protected var datumPlane: DatumPlane = _
2.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/AbstractHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
2.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/AbstractHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
2.3 @@ -45,7 +45,7 @@
2.4 import org.aiotrade.lib.charting.view.pane.DrawingPane
2.5 import org.aiotrade.lib.charting.view.pane.Pane
2.6 import org.aiotrade.lib.util.swing.action.EditAction
2.7 -import scala.collection.mutable.ArrayBuffer
2.8 +import org.aiotrade.lib.util.collection.ArrayList
2.9
2.10
2.11 /**
2.12 @@ -61,7 +61,7 @@
2.13 val VARIABLE_NUMBER_OF_HANDLES = Integer.MAX_VALUE
2.14 }
2.15
2.16 -abstract class AbstractHandledChart(drawing: DrawingPane, points: ArrayBuffer[ValuePoint]) extends HandledChart {
2.17 +abstract class AbstractHandledChart(drawing: DrawingPane, points: ArrayList[ValuePoint]) extends HandledChart {
2.18 import AbstractHandledChart._
2.19
2.20 private var drawingPane: DrawingPane = _
2.21 @@ -75,11 +75,11 @@
2.22 * another object, even in case of being got by others via public or
2.23 * protected method
2.24 */
2.25 - private val currentHandles = new ArrayBuffer[Handle]
2.26 - private val previousHandles = new ArrayBuffer[Handle]
2.27 + private val currentHandles = new ArrayList[Handle]
2.28 + private val previousHandles = new ArrayList[Handle]
2.29
2.30 /** For moving chart: the valuePoint and handls when mouse is pressed before drag */
2.31 - private val currentHandlesWhenMousePressed = new ArrayBuffer[Handle]
2.32 + private val currentHandlesWhenMousePressed = new ArrayList[Handle]
2.33 /**
2.34 * define mousePressedPoint as final to force using copy(..) to set its value
2.35 */
2.36 @@ -101,7 +101,7 @@
2.37 private var cursor: Cursor = _
2.38
2.39 private val pointBuf = new ValuePoint
2.40 - private val handlePointsBuf = new ArrayBuffer[ValuePoint]
2.41 + private val handlePointsBuf = new ArrayList[ValuePoint]
2.42
2.43
2.44 def this(drawing: DrawingPane) = this(drawing, null)
2.45 @@ -129,7 +129,7 @@
2.46 /**
2.47 * init with known points
2.48 */
2.49 - def init(drawing: DrawingPane, points: ArrayBuffer[ValuePoint]) {
2.50 + def init(drawing: DrawingPane, points: ArrayList[ValuePoint]) {
2.51 assert(points != null, "this is for points known HandledChart!")
2.52
2.53 attachDrawingPane(drawing)
2.54 @@ -385,7 +385,7 @@
2.55 }
2.56 }
2.57
2.58 - private def renderHandles(g: Graphics , handles: ArrayBuffer[Handle]) {
2.59 + private def renderHandles(g: Graphics , handles: ArrayList[Handle]) {
2.60 for (handle <- handles) {
2.61 handle.render(g)
2.62 }
2.63 @@ -411,11 +411,11 @@
2.64 readyToDrag
2.65 }
2.66
2.67 - def getCurrentHandlesPoints: ArrayBuffer[ValuePoint] = {
2.68 + def getCurrentHandlesPoints: ArrayList[ValuePoint] = {
2.69 handlesPoints(currentHandles)
2.70 }
2.71
2.72 - protected def handlesPoints(handles: ArrayBuffer[Handle]): ArrayBuffer[ValuePoint] = {
2.73 + protected def handlesPoints(handles: ArrayList[Handle]): ArrayList[ValuePoint] = {
2.74 handlePointsBuf.clear
2.75 var i = 0
2.76 val n = handles.size
2.77 @@ -478,7 +478,7 @@
2.78 setChartModelAndRenderChart(g, currentHandles)
2.79 }
2.80
2.81 - private def setChartModelAndRenderChart(g: Graphics, handles: ArrayBuffer[Handle]) {
2.82 + private def setChartModelAndRenderChart(g: Graphics, handles: ArrayList[Handle]) {
2.83 /** 1. set chart's model according to the handles */
2.84 setChartModel(handles)
2.85
2.86 @@ -494,7 +494,7 @@
2.87 *
2.88 * @param handles the list of handles to be used to set the model
2.89 */
2.90 - protected def setChartModel(handles: ArrayBuffer[Handle]): Unit
2.91 + protected def setChartModel(handles: ArrayList[Handle]): Unit
2.92
2.93 final def compareTo(another: HandledChart): Int = {
2.94 if (this.toString.equalsIgnoreCase(another.toString)) {
3.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/FibonacciArcsHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
3.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/FibonacciArcsHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
3.3 @@ -31,7 +31,7 @@
3.4 package org.aiotrade.lib.charting.chart.handledchart
3.5
3.6 import org.aiotrade.lib.charting.chart.segment.Handle
3.7 -import scala.collection.mutable.ArrayBuffer
3.8 +import org.aiotrade.lib.util.collection.ArrayList
3.9
3.10
3.11 /**
3.12 @@ -48,7 +48,7 @@
3.13 new FibonacciArcsChart
3.14 }
3.15
3.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
3.17 + protected def setChartModel(handles: ArrayList[Handle]) {
3.18 getChart.model.set(
3.19 handles(0).getPoint.t,
3.20 handles(0).getPoint.v,
4.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/FibonacciFanLinesHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
4.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/FibonacciFanLinesHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
4.3 @@ -31,7 +31,7 @@
4.4 package org.aiotrade.lib.charting.chart.handledchart
4.5
4.6 import org.aiotrade.lib.charting.chart.segment.Handle
4.7 -import scala.collection.mutable.ArrayBuffer
4.8 +import org.aiotrade.lib.util.collection.ArrayList
4.9
4.10
4.11 /**
4.12 @@ -47,7 +47,7 @@
4.13 new FibonacciFanLinesChart
4.14 }
4.15
4.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
4.17 + protected def setChartModel(handles: ArrayList[Handle]) {
4.18 getChart.model.set(
4.19 handles(0).getPoint.t,
4.20 handles(0).getPoint.v,
5.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/FibonacciRetracementsHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
5.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/FibonacciRetracementsHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
5.3 @@ -31,7 +31,7 @@
5.4 package org.aiotrade.lib.charting.chart.handledchart
5.5
5.6 import org.aiotrade.lib.charting.chart.segment.Handle
5.7 -import scala.collection.mutable.ArrayBuffer
5.8 +import org.aiotrade.lib.util.collection.ArrayList
5.9
5.10
5.11 /**
5.12 @@ -47,7 +47,7 @@
5.13 new FibonacciRetracementsChart
5.14 }
5.15
5.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
5.17 + protected def setChartModel(handles: ArrayList[Handle]) {
5.18 getChart.model.set(
5.19 handles(0).getPoint.t,
5.20 handles(0).getPoint.v,
6.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/FibonacciTimeZonesHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
6.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/FibonacciTimeZonesHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
6.3 @@ -31,7 +31,7 @@
6.4 package org.aiotrade.lib.charting.chart.handledchart
6.5
6.6 import org.aiotrade.lib.charting.chart.segment.Handle
6.7 -import scala.collection.mutable.ArrayBuffer
6.8 +import org.aiotrade.lib.util.collection.ArrayList
6.9
6.10
6.11 /**
6.12 @@ -47,7 +47,7 @@
6.13 new FibonacciTimeZonesChart
6.14 }
6.15
6.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
6.17 + protected def setChartModel(handles: ArrayList[Handle]) {
6.18 getChart.model.set(handles(0).getPoint.t)
6.19 }
6.20
7.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/FibonacciVerticalRetracementsHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
7.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/FibonacciVerticalRetracementsHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
7.3 @@ -31,7 +31,7 @@
7.4 package org.aiotrade.lib.charting.chart.handledchart
7.5
7.6 import org.aiotrade.lib.charting.chart.segment.Handle
7.7 -import scala.collection.mutable.ArrayBuffer
7.8 +import org.aiotrade.lib.util.collection.ArrayList
7.9
7.10
7.11 /**
7.12 @@ -47,7 +47,7 @@
7.13 new FibonacciVerticalRetracementsChart
7.14 }
7.15
7.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
7.17 + protected def setChartModel(handles: ArrayList[Handle]) {
7.18 getChart.model.set(
7.19 handles(0).getPoint.t,
7.20 handles(1).getPoint.t)
8.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/GannAngleHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
8.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/GannAngleHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
8.3 @@ -31,7 +31,7 @@
8.4 package org.aiotrade.lib.charting.chart.handledchart
8.5
8.6 import org.aiotrade.lib.charting.chart.segment.Handle
8.7 -import scala.collection.mutable.ArrayBuffer
8.8 +import org.aiotrade.lib.util.collection.ArrayList
8.9
8.10
8.11 /**
8.12 @@ -47,7 +47,7 @@
8.13 new GannAngleChart
8.14 }
8.15
8.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
8.17 + protected def setChartModel(handles: ArrayList[Handle]) {
8.18 getChart.model.set(
8.19 handles(0).getPoint.t,
8.20 handles(0).getPoint.v,
9.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/GannPeriodsHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
9.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/GannPeriodsHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
9.3 @@ -31,7 +31,7 @@
9.4 package org.aiotrade.lib.charting.chart.handledchart
9.5
9.6 import org.aiotrade.lib.charting.chart.segment.Handle
9.7 -import scala.collection.mutable.ArrayBuffer
9.8 +import org.aiotrade.lib.util.collection.ArrayList
9.9
9.10
9.11 /**
9.12 @@ -47,7 +47,7 @@
9.13 new GannPeriodsChart
9.14 }
9.15
9.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
9.17 + protected def setChartModel(handles: ArrayList[Handle]) {
9.18 getChart.model.set(handles(0).getPoint.t)
9.19 }
9.20
10.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/HandledChart.scala Mon Nov 02 17:30:56 2009 +0800
10.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/HandledChart.scala Mon Nov 02 19:50:46 2009 +0800
10.3 @@ -35,7 +35,7 @@
10.4 import org.aiotrade.lib.charting.chart.Chart
10.5 import org.aiotrade.lib.charting.chart.segment.ValuePoint
10.6 import org.aiotrade.lib.charting.view.pane.DrawingPane
10.7 -import scala.collection.mutable.ArrayBuffer
10.8 +import org.aiotrade.lib.util.collection.ArrayList
10.9
10.10 /**
10.11 *
10.12 @@ -49,7 +49,7 @@
10.13 type C <: Chart
10.14
10.15 /** init with known points */
10.16 - def init(drawing: DrawingPane, points: ArrayBuffer[ValuePoint]): Unit
10.17 + def init(drawing: DrawingPane, points: ArrayList[ValuePoint]): Unit
10.18
10.19 def attachDrawingPane(drawing: DrawingPane): Unit
10.20
10.21 @@ -68,7 +68,7 @@
10.22
10.23 def isAccomplished: Boolean
10.24
10.25 - def getCurrentHandlesPoints: ArrayBuffer[ValuePoint]
10.26 + def getCurrentHandlesPoints: ArrayList[ValuePoint]
10.27
10.28 def getChart: C
10.29
11.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/ParallelLinesHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
11.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/ParallelLinesHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
11.3 @@ -31,7 +31,7 @@
11.4 package org.aiotrade.lib.charting.chart.handledchart
11.5
11.6 import org.aiotrade.lib.charting.chart.segment.Handle
11.7 -import scala.collection.mutable.ArrayBuffer
11.8 +import org.aiotrade.lib.util.collection.ArrayList
11.9
11.10
11.11 /**
11.12 @@ -48,7 +48,7 @@
11.13 new ParallelLinesChart
11.14 }
11.15
11.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
11.17 + protected def setChartModel(handles: ArrayList[Handle]) {
11.18 getChart.model.set(
11.19 handles(0).getPoint.t,
11.20 handles(0).getPoint.v,
12.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/PercentHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
12.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/PercentHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
12.3 @@ -31,7 +31,7 @@
12.4 package org.aiotrade.lib.charting.chart.handledchart
12.5
12.6 import org.aiotrade.lib.charting.chart.segment.Handle
12.7 -import scala.collection.mutable.ArrayBuffer
12.8 +import org.aiotrade.lib.util.collection.ArrayList
12.9
12.10
12.11 /**
12.12 @@ -47,7 +47,7 @@
12.13 new PercentChart
12.14 }
12.15
12.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
12.17 + protected def setChartModel(handles: ArrayList[Handle]) {
12.18 getChart.model.set(
12.19 handles(0).getPoint.t,
12.20 handles(0).getPoint.v,
13.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/PeriodsHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
13.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/PeriodsHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
13.3 @@ -31,7 +31,7 @@
13.4 package org.aiotrade.lib.charting.chart.handledchart
13.5
13.6 import org.aiotrade.lib.charting.chart.segment.Handle
13.7 -import scala.collection.mutable.ArrayBuffer
13.8 +import org.aiotrade.lib.util.collection.ArrayList
13.9
13.10
13.11 /**
13.12 @@ -48,7 +48,7 @@
13.13 new PeriodsChart
13.14 }
13.15
13.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
13.17 + protected def setChartModel(handles: ArrayList[Handle]) {
13.18 getChart.model.set(
13.19 handles(0).getPoint.t,
13.20 handles(1).getPoint.t)
14.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/PolyStraightLineSegmentHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
14.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/PolyStraightLineSegmentHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
14.3 @@ -31,7 +31,7 @@
14.4 package org.aiotrade.lib.charting.chart.handledchart
14.5
14.6 import org.aiotrade.lib.charting.chart.segment.Handle
14.7 -import scala.collection.mutable.ArrayBuffer
14.8 +import org.aiotrade.lib.util.collection.ArrayList
14.9
14.10
14.11 /**
14.12 @@ -48,7 +48,7 @@
14.13 new StraightLineSegmentChart
14.14 }
14.15
14.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
14.17 + protected def setChartModel(handles: ArrayList[Handle]) {
14.18 getChart.model.set(handlesPoints(handles))
14.19 }
14.20
15.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/StraightLineHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
15.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/StraightLineHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
15.3 @@ -31,7 +31,7 @@
15.4 package org.aiotrade.lib.charting.chart.handledchart
15.5
15.6 import org.aiotrade.lib.charting.chart.segment.Handle
15.7 -import scala.collection.mutable.ArrayBuffer
15.8 +import org.aiotrade.lib.util.collection.ArrayList
15.9
15.10
15.11 /**
15.12 @@ -47,7 +47,7 @@
15.13 new StraightLineChart
15.14 }
15.15
15.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
15.17 + protected def setChartModel(handles: ArrayList[Handle]) {
15.18 getChart.model.set(
15.19 handles(0).getPoint.t,
15.20 handles(0).getPoint.v,
16.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/StraightLineSegmentChart.scala Mon Nov 02 17:30:56 2009 +0800
16.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/StraightLineSegmentChart.scala Mon Nov 02 19:50:46 2009 +0800
16.3 @@ -35,7 +35,7 @@
16.4 import org.aiotrade.lib.charting.chart.segment.ValuePoint
16.5 import org.aiotrade.lib.charting.laf.LookFeel
16.6 import org.aiotrade.lib.charting.widget.PathWidget
16.7 -import scala.collection.mutable.ArrayBuffer
16.8 +import org.aiotrade.lib.util.collection.ArrayList
16.9
16.10
16.11 /**
16.12 @@ -44,9 +44,9 @@
16.13 */
16.14 class StraightLineSegmentChart extends AbstractChart {
16.15 final class Model extends WidgetModel {
16.16 - var points: ArrayBuffer[ValuePoint] = _
16.17 + var points: ArrayList[ValuePoint] = _
16.18
16.19 - def set(points: ArrayBuffer[ValuePoint]) {
16.20 + def set(points: ArrayList[ValuePoint]) {
16.21 this.points = points
16.22 }
16.23 }
17.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/StraightLineSegmentHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
17.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/StraightLineSegmentHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
17.3 @@ -31,7 +31,7 @@
17.4 package org.aiotrade.lib.charting.chart.handledchart
17.5
17.6 import org.aiotrade.lib.charting.chart.segment.Handle
17.7 -import scala.collection.mutable.ArrayBuffer
17.8 +import org.aiotrade.lib.util.collection.ArrayList
17.9
17.10
17.11 /**
17.12 @@ -47,7 +47,7 @@
17.13 new StraightLineSegmentChart
17.14 }
17.15
17.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
17.17 + protected def setChartModel(handles: ArrayList[Handle]) {
17.18 getChart.model.set(handlesPoints(handles))
17.19 }
17.20
18.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/TextHandledChart.scala Mon Nov 02 17:30:56 2009 +0800
18.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/chart/handledchart/TextHandledChart.scala Mon Nov 02 19:50:46 2009 +0800
18.3 @@ -31,7 +31,7 @@
18.4 package org.aiotrade.lib.charting.chart.handledchart
18.5
18.6 import org.aiotrade.lib.charting.chart.segment.Handle
18.7 -import scala.collection.mutable.ArrayBuffer
18.8 +import org.aiotrade.lib.util.collection.ArrayList
18.9
18.10
18.11 /**
18.12 @@ -48,7 +48,7 @@
18.13 new TextChart
18.14 }
18.15
18.16 - protected def setChartModel(handles: ArrayBuffer[Handle]) {
18.17 + protected def setChartModel(handles: ArrayList[Handle]) {
18.18 getChart.model.set(handles(0).getPoint.t,
18.19 handles(0).getPoint.v)
18.20 }
19.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/descriptor/DrawingDescriptor.scala Mon Nov 02 17:30:56 2009 +0800
19.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/descriptor/DrawingDescriptor.scala Mon Nov 02 19:50:46 2009 +0800
19.3 @@ -37,7 +37,7 @@
19.4 import org.aiotrade.lib.charting.chart.segment.ValuePoint
19.5 import org.aiotrade.lib.charting.view.ChartView
19.6 import org.aiotrade.lib.charting.view.pane.DrawingPane
19.7 -import scala.collection.mutable.ArrayBuffer
19.8 +import org.aiotrade.lib.util.collection.ArrayList
19.9 import scala.collection.mutable.HashMap
19.10
19.11
19.12 @@ -47,7 +47,7 @@
19.13 */
19.14 class DrawingDescriptor(layerName: String) extends AnalysisDescriptor[DrawingPane] {
19.15
19.16 - private var handledChartMapPoints = new HashMap[HandledChart, ArrayBuffer[ValuePoint]]
19.17 + private var handledChartMapPoints = new HashMap[HandledChart, ArrayList[ValuePoint]]
19.18 var displayName = "Layout One"
19.19
19.20 serviceClassName = layerName
19.21 @@ -69,7 +69,7 @@
19.22 }
19.23
19.24
19.25 - def putHandledChart(handledChart: HandledChart, handlePoints: ArrayBuffer[ValuePoint]) {
19.26 + def putHandledChart(handledChart: HandledChart, handlePoints: ArrayList[ValuePoint]) {
19.27 handledChartMapPoints.put(handledChart, handlePoints);
19.28 }
19.29
19.30 @@ -77,11 +77,11 @@
19.31 handledChartMapPoints.remove(handledChart)
19.32 }
19.33
19.34 - def getHandledChartMapPoints: HashMap[HandledChart, ArrayBuffer[ValuePoint]] = {
19.35 + def getHandledChartMapPoints: HashMap[HandledChart, ArrayList[ValuePoint]] = {
19.36 handledChartMapPoints
19.37 }
19.38
19.39 - def setHandledChartMapPoints(handledChartMapPoints: HashMap[HandledChart, ArrayBuffer[ValuePoint]]) {
19.40 + def setHandledChartMapPoints(handledChartMapPoints: HashMap[HandledChart, ArrayList[ValuePoint]]) {
19.41 this.handledChartMapPoints = handledChartMapPoints
19.42 }
19.43
20.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/view/ChartingControllerFactory.scala Mon Nov 02 17:30:56 2009 +0800
20.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/view/ChartingControllerFactory.scala Mon Nov 02 19:50:46 2009 +0800
20.3 @@ -51,7 +51,7 @@
20.4 import org.aiotrade.lib.util.ChangeObserver
20.5 import org.aiotrade.lib.util.ChangeObservable
20.6 import org.aiotrade.lib.util.ChangeObservableHelper
20.7 -import scala.collection.mutable.ArrayBuffer
20.8 +import org.aiotrade.lib.util.collection.ArrayList
20.9 import scala.collection.mutable.HashMap
20.10 import scala.collection.mutable.HashSet
20.11
20.12 @@ -155,7 +155,7 @@
20.13
20.14 private def removeKeyMouseListenersFrom(component: JComponent) {
20.15 /** use a list to avoid concurrent issue */
20.16 - val toBeRemoved = new ArrayBuffer[AnyRef]
20.17 + val toBeRemoved = new ArrayList[AnyRef]
20.18
20.19 val ls = component.getKeyListeners.iterator
20.20 while (ls.hasNext) {
21.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/view/pane/Pane.scala Mon Nov 02 17:30:56 2009 +0800
21.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/view/pane/Pane.scala Mon Nov 02 19:50:46 2009 +0800
21.3 @@ -48,7 +48,7 @@
21.4 import org.aiotrade.lib.charting.widget.Widget
21.5 import scala.collection.immutable.SortedSet
21.6 import scala.collection.immutable.TreeSet
21.7 -import scala.collection.mutable.ArrayBuffer
21.8 +import org.aiotrade.lib.util.collection.ArrayList
21.9
21.10 protected abstract class RenderStrategy
21.11 protected object RenderStrategy {
21.12 @@ -74,7 +74,7 @@
21.13 abstract class Pane(protected val view: ChartView, protected var datumPlane: DatumPlane) extends JComponent {
21.14 import Pane._
21.15
21.16 - private val widgets = new ArrayBuffer[Widget]
21.17 + private val widgets = new ArrayList[Widget]
21.18 private var charts = new TreeSet[Chart]
21.19 private var referCursorChart: CursorChart = _
21.20 private var mouseCursorChart: CursorChart = _
22.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/widget/AbstractWidget.scala Mon Nov 02 17:30:56 2009 +0800
22.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/widget/AbstractWidget.scala Mon Nov 02 19:50:46 2009 +0800
22.3 @@ -41,8 +41,9 @@
22.4 import java.awt.geom.GeneralPath
22.5 import java.util.Collection
22.6 import javax.swing.Action
22.7 +import org.aiotrade.lib.util.collection.ArrayList
22.8 import org.aiotrade.lib.charting.util.PathPool
22.9 -import scala.collection.mutable.{ArrayBuffer, HashMap}
22.10 +import scala.collection.mutable.{HashMap}
22.11
22.12 /**
22.13 *
22.14 @@ -83,9 +84,9 @@
22.15 private var _model: M = _
22.16
22.17 private var renderColorsWithPathBuf: HashMap[Color, GeneralPath] = _
22.18 - private var actions: ArrayBuffer[Action] = _
22.19 + private var actions: ArrayList[Action] = _
22.20
22.21 - var children: ArrayBuffer[Widget] = _
22.22 + var children: ArrayList[Widget] = _
22.23
22.24 def isOpaque: Boolean = {
22.25 opaque
22.26 @@ -342,7 +343,7 @@
22.27
22.28 def addChild[T <: Widget](child: T) :T = {
22.29 if (children == null) {
22.30 - children = new ArrayBuffer[Widget]
22.31 + children = new ArrayList[Widget]
22.32 }
22.33
22.34 children += child
22.35 @@ -355,10 +356,10 @@
22.36 }
22.37 }
22.38
22.39 - def getChildren: ArrayBuffer[Widget] = {
22.40 + def getChildren: ArrayList[Widget] = {
22.41 if (children != null) {
22.42 children
22.43 - } else new ArrayBuffer[Widget]
22.44 + } else new ArrayList[Widget]
22.45 }
22.46
22.47 def resetChildren: Unit = {
22.48 @@ -375,8 +376,8 @@
22.49 }
22.50 }
22.51
22.52 - def lookupChildren[T <: Widget](widgetType: Class[T], foreground: Color): ArrayBuffer[T] = {
22.53 - val result = new ArrayBuffer[T]
22.54 + def lookupChildren[T <: Widget](widgetType: Class[T], foreground: Color): ArrayList[T] = {
22.55 + val result = new ArrayList[T]
22.56 if (children != null) {
22.57 for (child <- children) {
22.58 if (widgetType.isInstance(child) && child.getForeground.equals(foreground)) {
22.59 @@ -400,7 +401,7 @@
22.60
22.61 def addAction(action: Action): Action = {
22.62 if (actions == null) {
22.63 - actions = new ArrayBuffer[Action]
22.64 + actions = new ArrayList[Action]
22.65 }
22.66
22.67 actions += action
23.1 --- a/modules/lib.charting/src/org/aiotrade/lib/charting/widget/Widget.scala Mon Nov 02 17:30:56 2009 +0800
23.2 +++ b/modules/lib.charting/src/org/aiotrade/lib/charting/widget/Widget.scala Mon Nov 02 19:50:46 2009 +0800
23.3 @@ -36,7 +36,7 @@
23.4 import java.awt.Point
23.5 import java.awt.Rectangle
23.6 import javax.swing.Action
23.7 -import scala.collection.mutable.ArrayBuffer
23.8 +import org.aiotrade.lib.util.collection.ArrayList
23.9
23.10 /**
23.11 * bounds(x, y, width, height) is relative to location(lx, ly), so the final
23.12 @@ -109,7 +109,7 @@
23.13
23.14 def addChild[T <: Widget](child: T): T
23.15 def removeChild(child: Widget): Unit
23.16 - def children: ArrayBuffer[Widget]
23.17 + def children: ArrayList[Widget]
23.18 def clearChildren: Unit
23.19 def lookupChildren[T <: Widget](widgetType: Class[T], foreground: Color): Seq[T]
23.20 def lookupFirstChild[T <: Widget](widgetType: Class[T], foreground: Color): Option[T]
24.1 --- a/modules/lib.chartview/src/org/aiotrade/lib/chartview/AnalysisChartViewContainer.scala Mon Nov 02 17:30:56 2009 +0800
24.2 +++ b/modules/lib.chartview/src/org/aiotrade/lib/chartview/AnalysisChartViewContainer.scala Mon Nov 02 19:50:46 2009 +0800
24.3 @@ -40,7 +40,7 @@
24.4 import org.aiotrade.lib.math.timeseries.computable.Indicator
24.5 import org.aiotrade.lib.math.timeseries.computable.IndicatorDescriptor
24.6 import org.aiotrade.lib.securities.QuoteSer
24.7 -import scala.collection.mutable.ArrayBuffer
24.8 +import org.aiotrade.lib.util.collection.ArrayList
24.9
24.10
24.11 /**
24.12 @@ -67,8 +67,8 @@
24.13 setMasterView(quoteChartView, gbc)
24.14
24.15 /** use two list to record the active indicators and their order(index) for later showing */
24.16 - val indicatorDescriptorsToBeShowing = new ArrayBuffer[IndicatorDescriptor]
24.17 - val indicatorsToBeShowing = new ArrayBuffer[Indicator]
24.18 + val indicatorDescriptorsToBeShowing = new ArrayList[IndicatorDescriptor]
24.19 + val indicatorsToBeShowing = new ArrayList[Indicator]
24.20 for (descriptor <- getController.getContents.lookupDescriptors(classOf[IndicatorDescriptor])) {
24.21 if (descriptor.active && descriptor.freq.equals(getController.getMasterSer.freq)) {
24.22 descriptor.serviceInstance(getController.getMasterSer) foreach {indicator =>
25.1 --- a/modules/lib.chartview/src/org/aiotrade/lib/chartview/AnalysisQuoteChartView.scala Mon Nov 02 17:30:56 2009 +0800
25.2 +++ b/modules/lib.chartview/src/org/aiotrade/lib/chartview/AnalysisQuoteChartView.scala Mon Nov 02 19:50:46 2009 +0800
25.3 @@ -49,7 +49,7 @@
25.4 import org.aiotrade.lib.charting.view.pane.Pane
25.5 import org.aiotrade.lib.charting.laf.LookFeel
25.6 import org.aiotrade.lib.securities.QuoteSer
25.7 -import scala.collection.mutable.ArrayBuffer
25.8 +import org.aiotrade.lib.util.collection.ArrayList
25.9 import scala.collection.mutable.HashMap
25.10
25.11
25.12 @@ -220,7 +220,7 @@
25.13 }
25.14
25.15 private def refreshQuoteCompareSer {
25.16 - val optsForCompareIndicator = new ArrayBuffer[Factor]
25.17 + val optsForCompareIndicator = new ArrayList[Factor]
25.18
25.19 optsForCompareIndicator += (new DefaultFactor("Begin of Time Frame", rb(1)))
25.20 optsForCompareIndicator += (new DefaultFactor("End of Time Frame", rb(getNBars)))
26.1 --- a/modules/lib.chartview/src/org/aiotrade/lib/chartview/RealTimeChartViewContainer.scala Mon Nov 02 17:30:56 2009 +0800
26.2 +++ b/modules/lib.chartview/src/org/aiotrade/lib/chartview/RealTimeChartViewContainer.scala Mon Nov 02 19:50:46 2009 +0800
26.3 @@ -38,7 +38,7 @@
26.4 import org.aiotrade.lib.indicator.VOLIndicator
26.5 import org.aiotrade.lib.math.timeseries.computable.IndicatorDescriptor
26.6 import org.aiotrade.lib.securities.QuoteSer
26.7 -import scala.collection.mutable.ArrayBuffer
26.8 +import org.aiotrade.lib.util.collection.ArrayList
26.9
26.10
26.11 /**
26.12 @@ -46,7 +46,7 @@
26.13 * @author Caoyuan Deng
26.14 */
26.15 object RealTimeChartViewContainer {
26.16 - private val INSTANCES = new ArrayBuffer[RealTimeChartViewContainer]
26.17 + private val INSTANCES = new ArrayList[RealTimeChartViewContainer]
26.18 }
26.19
26.20 class RealTimeChartViewContainer extends ChartViewContainer {
27.1 --- a/modules/lib.chartview/src/org/aiotrade/lib/chartview/persistence/ContentsParseHandler.scala Mon Nov 02 17:30:56 2009 +0800
27.2 +++ b/modules/lib.chartview/src/org/aiotrade/lib/chartview/persistence/ContentsParseHandler.scala Mon Nov 02 19:50:46 2009 +0800
27.3 @@ -49,7 +49,7 @@
27.4 import org.xml.sax.SAXException
27.5 import org.xml.sax.helpers.AttributesImpl
27.6 import org.xml.sax.helpers.DefaultHandler
27.7 -import scala.collection.mutable.ArrayBuffer
27.8 +import org.aiotrade.lib.util.collection.ArrayList
27.9 import scala.collection.mutable.HashMap
27.10 import scala.collection.mutable.Stack
27.11
27.12 @@ -63,12 +63,12 @@
27.13 private var contents: AnalysisContents = _
27.14
27.15 private var indicatorDescriptor: IndicatorDescriptor = _
27.16 - private var factors: ArrayBuffer[Factor] = _
27.17 + private var factors: ArrayList[Factor] = _
27.18
27.19 private var drawingDescriptor: DrawingDescriptor = _
27.20 - private var handledChartMapPoints: HashMap[HandledChart, ArrayBuffer[ValuePoint]] = _
27.21 + private var handledChartMapPoints: HashMap[HandledChart, ArrayList[ValuePoint]] = _
27.22 private var handledChartClassName: String = _
27.23 - private var points: ArrayBuffer[ValuePoint] = _
27.24 + private var points: ArrayList[ValuePoint] = _
27.25
27.26 val DEBUG = false
27.27
27.28 @@ -168,7 +168,7 @@
27.29 meta.getValue("nunits").trim.toInt)
27.30 indicatorDescriptor.freq = freq
27.31
27.32 - factors = new ArrayBuffer
27.33 + factors = new ArrayList
27.34 }
27.35
27.36 @throws(classOf[SAXException])
27.37 @@ -186,7 +186,7 @@
27.38 System.err.println("start_chart: " + meta)
27.39 }
27.40 handledChartClassName = meta.getValue("class")
27.41 - points = new ArrayBuffer[ValuePoint]
27.42 + points = new ArrayList[ValuePoint]
27.43 }
27.44
27.45 @throws(classOf[SAXException])
28.1 --- a/modules/lib.indicator/src/org/aiotrade/lib/indicator/AbstractIndicator.scala Mon Nov 02 17:30:56 2009 +0800
28.2 +++ b/modules/lib.indicator/src/org/aiotrade/lib/indicator/AbstractIndicator.scala Mon Nov 02 19:50:46 2009 +0800
28.3 @@ -66,7 +66,7 @@
28.4 import org.aiotrade.lib.math.timeseries.computable.Indicator
28.5 import org.aiotrade.lib.math.timeseries.{DefaultTSer, TSer, TVar}
28.6 import org.aiotrade.lib.securities.QuoteSer
28.7 -import scala.collection.mutable.ArrayBuffer
28.8 +import org.aiotrade.lib.util.collection.ArrayList
28.9
28.10 /**
28.11 *
28.12 @@ -238,11 +238,11 @@
28.13 computableHelper.addFactor(factor)
28.14 }
28.15
28.16 - def factors: ArrayBuffer[Factor] = {
28.17 + def factors: ArrayList[Factor] = {
28.18 computableHelper.factors
28.19 }
28.20
28.21 - def factors_=(factors: ArrayBuffer[Factor]): Unit = {
28.22 + def factors_=(factors: ArrayList[Factor]): Unit = {
28.23 computableHelper.factors = factors
28.24 }
28.25
29.1 --- a/modules/lib.math/src/org/aiotrade/lib/math/IndicatorFunction.scala Mon Nov 02 17:30:56 2009 +0800
29.2 +++ b/modules/lib.math/src/org/aiotrade/lib/math/IndicatorFunction.scala Mon Nov 02 19:50:46 2009 +0800
29.3 @@ -30,7 +30,7 @@
29.4 */
29.5 package org.aiotrade.lib.math
29.6
29.7 -import scala.collection.mutable.ArrayBuffer
29.8 +import org.aiotrade.lib.util.collection.ArrayList
29.9
29.10 /**
29.11 *
29.12 @@ -38,7 +38,7 @@
29.13 */
29.14 object IndicatorFunction {
29.15
29.16 - def dmPlus(idx: Int, highs: ArrayBuffer[Float], lows: ArrayBuffer[Float]): Float = {
29.17 + def dmPlus(idx: Int, highs: ArrayList[Float], lows: ArrayList[Float]): Float = {
29.18 if (idx == 0) {
29.19
29.20 Float.NaN
29.21 @@ -70,7 +70,7 @@
29.22 }
29.23 }
29.24
29.25 - def dmMinus(idx: Int, highs: ArrayBuffer[Float], lows: ArrayBuffer[Float]): Float = {
29.26 + def dmMinus(idx: Int, highs: ArrayList[Float], lows: ArrayList[Float]): Float = {
29.27 if (idx == 0) {
29.28
29.29 Float.NaN
29.30 @@ -102,7 +102,7 @@
29.31 }
29.32 }
29.33
29.34 - def tr(idx: Int, highs: ArrayBuffer[Float], lows: ArrayBuffer[Float], closes: ArrayBuffer[Float]): Float = {
29.35 + def tr(idx: Int, highs: ArrayList[Float], lows: ArrayList[Float], closes: ArrayList[Float]): Float = {
29.36 if (idx == 0) {
29.37
29.38 Float.NaN
29.39 @@ -115,15 +115,15 @@
29.40 }
29.41 }
29.42
29.43 - def diPlus(idx: Int, period: Int, highs: ArrayBuffer[Float], lows: ArrayBuffer[Float], closes: ArrayBuffer[Float]): Float = {
29.44 + def diPlus(idx: Int, period: Int, highs: ArrayList[Float], lows: ArrayList[Float], closes: ArrayList[Float]): Float = {
29.45 if (idx < period - 1) {
29.46
29.47 Float.NaN
29.48
29.49 } else {
29.50
29.51 - val dms = new ArrayBuffer[Float]
29.52 - val trs = new ArrayBuffer[Float]
29.53 + val dms = new ArrayList[Float]
29.54 + val trs = new ArrayList[Float]
29.55
29.56 val fromIdx = idx - (period - 1)
29.57 val toIdx = idx
29.58 @@ -145,15 +145,15 @@
29.59 }
29.60 }
29.61
29.62 - def diMinus(idx: Int, period: Int, highs: ArrayBuffer[Float], lows: ArrayBuffer[Float], closes: ArrayBuffer[Float]): Float = {
29.63 + def diMinus(idx: Int, period: Int, highs: ArrayList[Float], lows: ArrayList[Float], closes: ArrayList[Float]): Float = {
29.64 if (idx < period - 1) {
29.65
29.66 Float.NaN
29.67
29.68 } else {
29.69
29.70 - val dms = new ArrayBuffer[Float]
29.71 - val trs = new ArrayBuffer[Float]
29.72 + val dms = new ArrayList[Float]
29.73 + val trs = new ArrayList[Float]
29.74
29.75 val fromIdx = idx - (period - 1)
29.76 val toIdx = idx
29.77 @@ -175,7 +175,7 @@
29.78 }
29.79 }
29.80
29.81 - def dx(idx: Int, period: Int, highs: ArrayBuffer[Float], lows: ArrayBuffer[Float], closes: ArrayBuffer[Float]): Float = {
29.82 + def dx(idx: Int, period: Int, highs: ArrayList[Float], lows: ArrayList[Float], closes: ArrayList[Float]): Float = {
29.83 if (idx < period - 1) {
29.84
29.85 Float.NaN
29.86 @@ -190,14 +190,14 @@
29.87 }
29.88 }
29.89
29.90 - def adx(idx: Int, periodDI: Int, periodADX: Int, highs: ArrayBuffer[Float], lows: ArrayBuffer[Float], closes: ArrayBuffer[Float]): Float = {
29.91 + def adx(idx: Int, periodDI: Int, periodADX: Int, highs: ArrayList[Float], lows: ArrayList[Float], closes: ArrayList[Float]): Float = {
29.92 if (idx < periodDI - 1 || idx < periodADX - 1) {
29.93
29.94 Float.NaN
29.95
29.96 } else {
29.97
29.98 - val dxes = new ArrayBuffer[Float]
29.99 + val dxes = new ArrayList[Float]
29.100
29.101 val fromIdx = idx - (periodADX - 1)
29.102 val toIdx = idx
29.103 @@ -215,7 +215,7 @@
29.104 }
29.105 }
29.106
29.107 - def adxr(idx: Int, periodDI: Int, periodADX: Int, highs: ArrayBuffer[Float], lows: ArrayBuffer[Float], closes: ArrayBuffer[Float]): Float = {
29.108 + def adxr(idx: Int, periodDI: Int, periodADX: Int, highs: ArrayList[Float], lows: ArrayList[Float], closes: ArrayList[Float]): Float = {
29.109 if (idx < periodDI - 1 || idx < periodADX - 1) {
29.110
29.111 Float.NaN
30.1 --- a/modules/lib.math/src/org/aiotrade/lib/math/StatisticFunction.scala Mon Nov 02 17:30:56 2009 +0800
30.2 +++ b/modules/lib.math/src/org/aiotrade/lib/math/StatisticFunction.scala Mon Nov 02 19:50:46 2009 +0800
30.3 @@ -30,7 +30,7 @@
30.4 */
30.5 package org.aiotrade.lib.math
30.6
30.7 -import scala.collection.mutable.ArrayBuffer
30.8 +import org.aiotrade.lib.util.collection.ArrayList
30.9
30.10 /**
30.11 *
30.12 @@ -43,7 +43,7 @@
30.13 val VALUE = 0
30.14 val MASS = 1
30.15
30.16 - def sum(values: ArrayBuffer[Float], begIdx: Int, endIdx: Int): Float = {
30.17 + def sum(values: ArrayList[Float], begIdx: Int, endIdx: Int): Float = {
30.18 if (begIdx < 0 || endIdx >= values.size) {
30.19 return Float.NaN
30.20 }
30.21 @@ -59,7 +59,7 @@
30.22 sum
30.23 }
30.24
30.25 - def isum(idx: Int, values: ArrayBuffer[Float], period: Int, prev: Float): Float = {
30.26 + def isum(idx: Int, values: ArrayList[Float], period: Int, prev: Float): Float = {
30.27 val lookbackIdx = lookback(idx, period)
30.28
30.29 if (lookbackIdx < 0 || idx >= values.size) {
30.30 @@ -81,7 +81,7 @@
30.31 }
30.32 }
30.33
30.34 - def ma(values: ArrayBuffer[Float], begIdx: Int, endIdx: Int): Float = {
30.35 + def ma(values: ArrayList[Float], begIdx: Int, endIdx: Int): Float = {
30.36 if (begIdx < 0 || endIdx >= values.size) {
30.37 return Float.NaN
30.38 }
30.39 @@ -93,7 +93,7 @@
30.40 /**
30.41 * ma(t + 1) = ma(t) + ( x(t) / N - x(t - n) / N )
30.42 */
30.43 - def ima(idx: Int, values: ArrayBuffer[Float], period: Int, prev: Float): Float = {
30.44 + def ima(idx: Int, values: ArrayList[Float], period: Int, prev: Float): Float = {
30.45 val lookbackIdx = lookback(idx, period)
30.46
30.47 if (lookbackIdx < 0 || idx >= values.size) {
30.48 @@ -115,7 +115,7 @@
30.49 }
30.50 }
30.51
30.52 - def ema(values: ArrayBuffer[Float], begIdx: Int, endIdx: Int): Float = {
30.53 + def ema(values: ArrayList[Float], begIdx: Int, endIdx: Int): Float = {
30.54 if (begIdx < 0 || endIdx >= values.size) {
30.55 return Float.NaN
30.56 }
30.57 @@ -136,7 +136,7 @@
30.58 * = (1 - 1/N) * ema(t) + (1/N) * x(t)
30.59 * = (1 - a) * ema(t) + a * x(t) // let a = 1/N
30.60 */
30.61 - def iema(idx: Int, values: ArrayBuffer[Float], period: Int, prev: Float): Float = {
30.62 + def iema(idx: Int, values: ArrayList[Float], period: Int, prev: Float): Float = {
30.63 val value = values(idx) match {
30.64 case x if x.isNaN => 0f
30.65 case x => x
30.66 @@ -147,11 +147,11 @@
30.67 //return ((period - 1.0f) / (period + 1.0f)) * prevEma + (2.0f / (period + 1.0f)) * value;
30.68 }
30.69
30.70 - def max(values: ArrayBuffer[Float], begIdx: Int, endIdx: Int): Float = {
30.71 + def max(values: ArrayList[Float], begIdx: Int, endIdx: Int): Float = {
30.72 maxmin(values, begIdx, endIdx)(MAX)
30.73 }
30.74
30.75 - def imax(idx: Int, values: ArrayBuffer[Float], period: Int, prev: Float): Float = {
30.76 + def imax(idx: Int, values: ArrayList[Float], period: Int, prev: Float): Float = {
30.77 val lookbackIdx = lookback(idx, period)
30.78
30.79 if (lookbackIdx < 0 || idx >= values.size) {
30.80 @@ -168,11 +168,11 @@
30.81 }
30.82 }
30.83
30.84 - def min(values: ArrayBuffer[Float], begIdx: Int, endIdx: Int): Float = {
30.85 + def min(values: ArrayList[Float], begIdx: Int, endIdx: Int): Float = {
30.86 maxmin(values, begIdx, endIdx)(MIN)
30.87 }
30.88
30.89 - def imin(idx: Int, values: ArrayBuffer[Float], period: Int, prev: Float): Float = {
30.90 + def imin(idx: Int, values: ArrayList[Float], period: Int, prev: Float): Float = {
30.91 val lookbackIdx = lookback(idx, period)
30.92
30.93 if (lookbackIdx < 0 || idx >= values.size) {
30.94 @@ -189,7 +189,7 @@
30.95 }
30.96 }
30.97
30.98 - def maxmin(values: ArrayBuffer[Float], begIdx: Int, endIdx: Int): Array[Float] = {
30.99 + def maxmin(values: ArrayList[Float], begIdx: Int, endIdx: Int): Array[Float] = {
30.100 if (begIdx < 0) {
30.101 return Array(Float.NaN, Float.NaN)
30.102 }
30.103 @@ -230,7 +230,7 @@
30.104 /**
30.105 * Standard Deviation
30.106 */
30.107 - def stdDev(values: ArrayBuffer[Float], begIdx: Int, endIdx: Int): Float = {
30.108 + def stdDev(values: ArrayList[Float], begIdx: Int, endIdx: Int): Float = {
30.109 if (begIdx < 0 || endIdx >= values.size) {
30.110 return Float.NaN
30.111 }
30.112 @@ -252,14 +252,14 @@
30.113 /**
30.114 * Probability Mass Function
30.115 */
30.116 - def probMass(values: ArrayBuffer[Float], begIdx: Int, endIdx: Int, nIntervals: Int): Array[Array[Float]] = {
30.117 + def probMass(values: ArrayList[Float], begIdx: Int, endIdx: Int, nIntervals: Int): Array[Array[Float]] = {
30.118 probMass(values, null, begIdx, endIdx, nIntervals)
30.119 }
30.120
30.121 /**
30.122 * Probability Mass Function
30.123 */
30.124 - def probMass(values: ArrayBuffer[Float], weights: ArrayBuffer[Float],
30.125 + def probMass(values: ArrayList[Float], weights: ArrayList[Float],
30.126 begIdx: Int, endIdx: Int, nIntervals: Int
30.127 ): Array[Array[Float]] = {
30.128
30.129 @@ -278,7 +278,7 @@
30.130 /**
30.131 * Probability Density Function
30.132 */
30.133 - def probMass(values: ArrayBuffer[Float],
30.134 + def probMass(values: ArrayList[Float],
30.135 begIdx: Int, endIdx: Int, interval: Double
30.136 ): Array[Array[Float]] = {
30.137
30.138 @@ -288,7 +288,7 @@
30.139 /**
30.140 * Probability Mass Function
30.141 */
30.142 - def probMass(values: ArrayBuffer[Float], weights: ArrayBuffer[Float],
30.143 + def probMass(values: ArrayList[Float], weights: ArrayList[Float],
30.144 begIdx: Int, endIdx: Int, interval: Double
30.145 ): Array[Array[Float]] = {
30.146
30.147 @@ -308,7 +308,7 @@
30.148 /**
30.149 * Probability Mass Function
30.150 */
30.151 - private def probMass(values: ArrayBuffer[Float], weights: ArrayBuffer[Float],
30.152 + private def probMass(values: ArrayList[Float], weights: ArrayList[Float],
30.153 begIdx: Int, endIdx: Int, max: Float, min: Float, nIntervals: Int
30.154 ): Array[Array[Float]] = {
30.155
30.156 @@ -351,7 +351,7 @@
30.157 /**
30.158 * Probability Density Function
30.159 */
30.160 - def probMassWithTimeInfo(values: ArrayBuffer[Float], weights: ArrayBuffer[Float],
30.161 + def probMassWithTimeInfo(values: ArrayList[Float], weights: ArrayList[Float],
30.162 begIdx: Int, endIdx: Int, interval: Float
30.163 ): Array[Array[Float]] = {
30.164
31.1 --- a/modules/lib.math/src/org/aiotrade/lib/math/timeseries/DefaultTSer.scala Mon Nov 02 17:30:56 2009 +0800
31.2 +++ b/modules/lib.math/src/org/aiotrade/lib/math/timeseries/DefaultTSer.scala Mon Nov 02 19:50:46 2009 +0800
31.3 @@ -32,9 +32,9 @@
31.4
31.5 import java.awt.Color
31.6 import java.util.Calendar
31.7 +import org.aiotrade.lib.util.collection.ArrayList
31.8 import org.aiotrade.lib.math.timeseries.computable.SpotComputable
31.9 import org.aiotrade.lib.math.timeseries.plottable.Plot
31.10 -import scala.collection.mutable.{ArrayBuffer}
31.11
31.12
31.13 /**
31.14 @@ -70,7 +70,7 @@
31.15 */
31.16 private var _timestamps: TStamps = TStampsFactory.createInstance(INIT_CAPACITY)
31.17
31.18 - private var _items = new ArrayBuffer[TItem]//{override val initialSize = INIT_CAPACITY}// this will cause timestamps' lock deadlock?
31.19 + private var _items = new ArrayList[TItem]//{override val initialSize = INIT_CAPACITY}// this will cause timestamps' lock deadlock?
31.20
31.21 private var tsLog = timestamps.log
31.22 private var tsLogCheckedCursor = 0
31.23 @@ -82,7 +82,7 @@
31.24 * Each var element of array is a Var that contains a sequence of values for one field of SerItem.
31.25 * @Note: Don't use scala's HashSet or HashMap to store Var, these classes seems won't get all of them stored
31.26 */
31.27 - val vars = new ArrayBuffer[TVar[_]]
31.28 + val vars = new ArrayList[TVar[_]]
31.29
31.30 def this() = this(TFreq.DAILY)
31.31
31.32 @@ -237,7 +237,7 @@
31.33 timestamps.readLock.lock
31.34
31.35 vars foreach (x => x.validate)
31.36 - val newItems = new ArrayBuffer[TItem]
31.37 + val newItems = new ArrayList[TItem]
31.38 var i = 0
31.39 while (i < timestamps.size) {
31.40 val time = timestamps(i)
31.41 @@ -366,7 +366,7 @@
31.42 Long.MaxValue))
31.43 }
31.44
31.45 - def items: ArrayBuffer[TItem] = _items
31.46 + def items: ArrayList[TItem] = _items
31.47
31.48 def getItem(time: Long): TItem = {
31.49 var item = internal_getItem(time)
31.50 @@ -453,7 +453,7 @@
31.51 protected class InnerTVar[@specialized V: Manifest](name: String, plot: Plot
31.52 ) extends AbstractInnerTVar[V](name, plot) {
31.53
31.54 - var values = new ArrayBuffer[V]
31.55 + var values = new ArrayList[V]
31.56
31.57 def add(time: Long, value: V): Boolean = {
31.58 val idx = timestamps.indexOfOccurredTime(time)
31.59 @@ -482,7 +482,7 @@
31.60 }
31.61
31.62 def validate: Unit = {
31.63 - val newValues = new ArrayBuffer[V] {override val initialSize = INIT_CAPACITY}
31.64 + val newValues = new ArrayList[V] {override val initialSize = INIT_CAPACITY}
31.65
31.66 var i = 0
31.67 var j = 0
32.1 --- a/modules/lib.math/src/org/aiotrade/lib/math/timeseries/TSer.scala Mon Nov 02 17:30:56 2009 +0800
32.2 +++ b/modules/lib.math/src/org/aiotrade/lib/math/timeseries/TSer.scala Mon Nov 02 19:50:46 2009 +0800
32.3 @@ -30,7 +30,7 @@
32.4 */
32.5 package org.aiotrade.lib.math.timeseries
32.6
32.7 -import scala.collection.mutable.ArrayBuffer
32.8 +import org.aiotrade.lib.util.collection.ArrayList
32.9 import scala.actors.Actor._
32.10
32.11 /**
32.12 @@ -59,7 +59,7 @@
32.13 def freq: TFreq
32.14
32.15 def vars: Seq[TVar[_]]
32.16 - def items: ArrayBuffer[TItem]
32.17 + def items: ArrayList[TItem]
32.18
32.19 def getItem(time: Long): TItem
32.20
33.1 --- a/modules/lib.math/src/org/aiotrade/lib/math/timeseries/TStampedMapBasedList.scala Mon Nov 02 17:30:56 2009 +0800
33.2 +++ b/modules/lib.math/src/org/aiotrade/lib/math/timeseries/TStampedMapBasedList.scala Mon Nov 02 19:50:46 2009 +0800
33.3 @@ -30,7 +30,8 @@
33.4 */
33.5 package org.aiotrade.lib.math.timeseries
33.6
33.7 -import scala.collection.mutable.{ArrayBuffer,HashMap}
33.8 +import org.aiotrade.lib.util.collection.ArrayList
33.9 +import scala.collection.mutable.{HashMap}
33.10
33.11 /**
33.12 * A package class that implements timestamped Map based List, used to store
33.13 @@ -122,7 +123,7 @@
33.14 * @version 1.0, 11/22/2006
33.15 * @since 1.0.4
33.16 */
33.17 -class TStampedMapBasedList[A](timestamps: TStamps) extends ArrayBuffer[A] {
33.18 +class TStampedMapBasedList[A](timestamps: TStamps) extends ArrayList[A] {
33.19
33.20 private val timeToElementData = new HashMap[Long, A]()
33.21
33.22 @@ -130,7 +131,7 @@
33.23
33.24 override def isEmpty :Boolean = timestamps.isEmpty
33.25
33.26 - override def contains(o:Any) :Boolean = timeToElementData.values.contains(o)
33.27 + override def contains(o: Any) :Boolean = timeToElementData.valuesIterator.contains(o)
33.28
33.29 override def toArray[B >: A : ClassManifest]: Array[B] = {
33.30 val length = timestamps.size
33.31 @@ -151,7 +152,7 @@
33.32 xs
33.33 }
33.34
33.35 - def add(time:Long, elem:A) :Boolean = {
33.36 + def add(time: Long, elem:A) :Boolean = {
33.37 if (elem == null) {
33.38 /** null value needs not to be put in map, this will spare the memory usage */
33.39 return true
33.40 @@ -167,9 +168,9 @@
33.41 }
33.42 }
33.43
33.44 - def getByTime(time:Long) :A = timeToElementData.get(time).get
33.45 + def getByTime(time: Long): A = timeToElementData.get(time).get
33.46
33.47 - def setByTime(time:Long, elem:A) :A = {
33.48 + def setByTime(time: Long, elem: A): A = {
33.49 if (timestamps.contains(time)) {
33.50 timeToElementData.put(time, elem)
33.51 elem
33.52 @@ -183,7 +184,7 @@
33.53 *
33.54 */
33.55 @deprecated
33.56 - override def +(elem:A) :ArrayBuffer[A] = {
33.57 + override def +(elem: A) :ArrayList[A] = {
33.58 assert(false, "+(elem:A) is not supported by this collection! " +
33.59 ", please use add(long time, E o)")
33.60 this
33.61 @@ -192,18 +193,18 @@
33.62 /**
33.63 * @deprecated
33.64 */
33.65 - override def insert(n: Int, elems:A*): Unit = {
33.66 + override def insert(n: Int, elems: A*): Unit = {
33.67 assert(false, "insert(n: Int, elems:A*) is not supported by this collection! " +
33.68 ", please use add(long time, E o)")
33.69 }
33.70
33.71 override def clear: Unit = timeToElementData.clear
33.72
33.73 - override def equals(o:Any) :Boolean = timeToElementData.equals(o)
33.74 + override def equals(o: Any) :Boolean = timeToElementData.equals(o)
33.75
33.76 - override def hashCode :Int = timeToElementData.hashCode
33.77 + override def hashCode: Int = timeToElementData.hashCode
33.78
33.79 - override def apply(n: Int) :A = {
33.80 + override def apply(n: Int): A = {
33.81 val time = timestamps(n)
33.82 if (time != null) timeToElementData.get(time).get else null.asInstanceOf[A]
33.83 }
33.84 @@ -215,11 +216,11 @@
33.85 } else assert(false, "Index out of bounds! index = " + n)
33.86 }
33.87
33.88 - override def remove(n: Int) :A = {
33.89 + override def remove(n: Int): A = {
33.90 if (n >= 0 && n < timestamps.size) {
33.91 val time = timestamps(n)
33.92 val e = timeToElementData.get(n).get
33.93 - timeToElementData.removeKey(time)
33.94 + timeToElementData.remove(time)
33.95 e
33.96 } else {
33.97 null.asInstanceOf[A]
33.98 @@ -227,7 +228,7 @@
33.99 }
33.100
33.101 override def indexOf[B >: A](elem: B) : Int = {
33.102 - val itr = timeToElementData.keys
33.103 + val itr = timeToElementData.keysIterator
33.104 while (itr.hasNext) {
33.105 val time = itr.next
33.106 if (timeToElementData.get(time).get == elem) {
33.107 @@ -240,7 +241,7 @@
33.108
33.109 override def lastIndexOf[B >: A](elem: B) : Int = {
33.110 var found = -1
33.111 - val itr = timeToElementData.keys
33.112 + val itr = timeToElementData.keysIterator
33.113 while (itr.hasNext) {
33.114 val time = itr.next
33.115 if (timeToElementData.get(time).get == elem) {
34.1 --- a/modules/lib.math/src/org/aiotrade/lib/math/timeseries/TStamps.scala Mon Nov 02 17:30:56 2009 +0800
34.2 +++ b/modules/lib.math/src/org/aiotrade/lib/math/timeseries/TStamps.scala Mon Nov 02 19:50:46 2009 +0800
34.3 @@ -30,7 +30,7 @@
34.4 */
34.5 package org.aiotrade.lib.math.timeseries
34.6
34.7 -import scala.collection.mutable.ArrayBuffer
34.8 +import org.aiotrade.lib.util.collection.ArrayList
34.9
34.10 /**
34.11 *
34.12 @@ -57,7 +57,7 @@
34.13 val REMOVE = 0x8000 // 1000 0000 0000 0000
34.14 val NUMBER = 0xC000 // 1100 0000 0000 0000
34.15 }
34.16 -class TStampsLog extends ArrayBuffer[Short] {
34.17 +class TStampsLog extends ArrayList[Short] {
34.18 import TStampsLog._
34.19
34.20 private var _logCursor = -1
34.21 @@ -186,7 +186,7 @@
34.22 import java.util.concurrent.locks.{Lock,ReentrantReadWriteLock}
34.23
34.24 @cloneable
34.25 -trait TStamps extends ArrayBuffer[Long] {
34.26 +trait TStamps extends ArrayList[Long] {
34.27 val LONG_LONG_AGO = new GregorianCalendar(1900, Calendar.JANUARY, 1).getTimeInMillis
34.28
34.29 private val readWriteLock = new ReentrantReadWriteLock
35.1 --- a/modules/lib.math/src/org/aiotrade/lib/math/timeseries/TVar.scala Mon Nov 02 17:30:56 2009 +0800
35.2 +++ b/modules/lib.math/src/org/aiotrade/lib/math/timeseries/TVar.scala Mon Nov 02 19:50:46 2009 +0800
35.3 @@ -31,7 +31,7 @@
35.4 package org.aiotrade.lib.math.timeseries
35.5
35.6 import org.aiotrade.lib.math.timeseries.plottable.Plottable
35.7 -import scala.collection.mutable.ArrayBuffer
35.8 +import org.aiotrade.lib.util.collection.ArrayList
35.9
35.10
35.11 /**
35.12 @@ -58,7 +58,7 @@
35.13
35.14 def toDoubleArray: Array[Double]
35.15
35.16 - def values: ArrayBuffer[V]
35.17 + def values: ArrayList[V]
35.18
35.19 def nullValue: V
35.20
36.1 --- a/modules/lib.math/src/org/aiotrade/lib/math/timeseries/computable/Computable.scala Mon Nov 02 17:30:56 2009 +0800
36.2 +++ b/modules/lib.math/src/org/aiotrade/lib/math/timeseries/computable/Computable.scala Mon Nov 02 19:50:46 2009 +0800
36.3 @@ -30,7 +30,7 @@
36.4 */
36.5 package org.aiotrade.lib.math.timeseries.computable
36.6
36.7 -import scala.collection.mutable.ArrayBuffer
36.8 +import org.aiotrade.lib.util.collection.ArrayList
36.9 import java.text.DecimalFormat
36.10 import org.aiotrade.lib.math.timeseries.TSer
36.11 import scala.actors.Actor._
36.12 @@ -58,8 +58,8 @@
36.13 def computeFrom(time: Long): Unit
36.14 def computedTime: Long
36.15
36.16 - def factors: ArrayBuffer[Factor]
36.17 - def factors_=(factors: ArrayBuffer[Factor]): Unit
36.18 + def factors: ArrayList[Factor]
36.19 + def factors_=(factors: ArrayList[Factor]): Unit
36.20 def factors_=(values: Array[Number]): Unit
36.21
36.22 def dispose: Unit
36.23 @@ -73,7 +73,7 @@
36.24 case _ => ser.shortDescription
36.25 }
36.26
36.27 - def displayName(name: String, factors: ArrayBuffer[Factor]): String = {
36.28 + def displayName(name: String, factors: ArrayList[Factor]): String = {
36.29 factors map {x => FAC_DECIMAL_FORMAT.format(x.value)} mkString("(", ",", ")")
36.30 }
36.31 }
37.1 --- a/modules/lib.math/src/org/aiotrade/lib/math/timeseries/computable/ComputableHelper.scala Mon Nov 02 17:30:56 2009 +0800
37.2 +++ b/modules/lib.math/src/org/aiotrade/lib/math/timeseries/computable/ComputableHelper.scala Mon Nov 02 19:50:46 2009 +0800
37.3 @@ -32,7 +32,7 @@
37.4 package computable
37.5
37.6 import org.aiotrade.lib.math.timeseries.TSer
37.7 -import scala.collection.mutable.ArrayBuffer
37.8 +import org.aiotrade.lib.util.collection.ArrayList
37.9
37.10
37.11 /**
37.12 @@ -50,7 +50,7 @@
37.13 * factors of this instance, such as period long, period short etc,
37.14 * it's 'final' to avoid being replaced somewhere.
37.15 */
37.16 - var _factors = new ArrayBuffer[Factor]
37.17 + var _factors = new ArrayList[Factor]
37.18
37.19 private var baseSerChangeListener: SerChangeListener = _
37.20
37.21 @@ -227,14 +227,14 @@
37.22 })
37.23 }
37.24
37.25 - def factors: ArrayBuffer[Factor] = _factors
37.26 + def factors: ArrayList[Factor] = _factors
37.27
37.28 /**
37.29 *
37.30 *
37.31 * @return if any value of factors changed, return true, else return false
37.32 */
37.33 - def factors_=(factors: ArrayBuffer[Factor]): Unit = {
37.34 + def factors_=(factors: ArrayList[Factor]): Unit = {
37.35 if (factors != null) {
37.36 val values = new Array[Number](factors.size)
37.37 for (i <- 0 until factors.size) {
38.1 --- a/modules/lib.math/src/org/aiotrade/lib/math/timeseries/computable/IndicatorDescriptor.scala Mon Nov 02 17:30:56 2009 +0800
38.2 +++ b/modules/lib.math/src/org/aiotrade/lib/math/timeseries/computable/IndicatorDescriptor.scala Mon Nov 02 19:50:46 2009 +0800
38.3 @@ -37,18 +37,18 @@
38.4 import org.aiotrade.lib.math.timeseries.TSer
38.5 import org.aiotrade.lib.util.serialization.BeansDocument
38.6 import org.w3c.dom.Element
38.7 -import scala.collection.mutable.ArrayBuffer
38.8 +import org.aiotrade.lib.util.collection.ArrayList
38.9
38.10 /**
38.11 *
38.12 * @author Caoyuan Deng
38.13 */
38.14 -class IndicatorDescriptor(aserviceClassName: String, afreq: TFreq, afactors: ArrayBuffer[Factor], aactive: Boolean) extends AnalysisDescriptor[Indicator](aserviceClassName, afreq, aactive) {
38.15 +class IndicatorDescriptor(aserviceClassName: String, afreq: TFreq, afactors: ArrayList[Factor], aactive: Boolean) extends AnalysisDescriptor[Indicator](aserviceClassName, afreq, aactive) {
38.16
38.17 - private var _factors: ArrayBuffer[Factor] = afactors
38.18 + private var _factors: ArrayList[Factor] = afactors
38.19
38.20 def this() {
38.21 - this(null, TFreq.DAILY, new ArrayBuffer[Factor], false)
38.22 + this(null, TFreq.DAILY, new ArrayList[Factor], false)
38.23
38.24 }
38.25
38.26 @@ -58,8 +58,8 @@
38.27 setFacsToDefault
38.28 }
38.29
38.30 - def factors: ArrayBuffer[Factor]= _factors
38.31 - def factors_=(factors: ArrayBuffer[Factor]): Unit = {
38.32 + def factors: ArrayList[Factor]= _factors
38.33 + def factors_=(factors: ArrayList[Factor]): Unit = {
38.34 /**
38.35 * @NOTICE:
38.36 * always create a new copy of in factors to seperate the factors of this
39.1 --- a/modules/lib.math/src/org/aiotrade/lib/math/timeseries/datasource/AbstractDataServer.scala Mon Nov 02 17:30:56 2009 +0800
39.2 +++ b/modules/lib.math/src/org/aiotrade/lib/math/timeseries/datasource/AbstractDataServer.scala Mon Nov 02 19:50:46 2009 +0800
39.3 @@ -31,24 +31,20 @@
39.4 package org.aiotrade.lib.math.timeseries
39.5 package datasource
39.6
39.7 -import java.awt.Image;
39.8 -import java.awt.Toolkit;
39.9 -import java.io.InputStream;
39.10 -import java.net.URL;
39.11 -import java.text.DateFormat;
39.12 -import java.text.SimpleDateFormat;
39.13 -import java.util.ArrayList;
39.14 -import java.util.Calendar;
39.15 -import java.util.Collection;
39.16 -import java.util.Locale;
39.17 -import java.util.TimeZone;
39.18 -import java.util.Timer;
39.19 -import java.util.TimerTask;
39.20 -import java.util.concurrent.ExecutorService;
39.21 -import java.util.concurrent.Executors;
39.22 -import org.aiotrade.lib.math.timeseries.{TSer,SerChangeEvent}
39.23 +import java.awt.Image
39.24 +import java.awt.Toolkit
39.25 +import java.io.InputStream
39.26 +import java.text.DateFormat
39.27 +import java.text.SimpleDateFormat
39.28 +import java.util.TimeZone
39.29 +import java.util.Timer
39.30 +import java.util.TimerTask
39.31 +import java.util.concurrent.ExecutorService
39.32 +import java.util.concurrent.Executors
39.33 +import org.aiotrade.lib.util.collection.ArrayList
39.34 +import org.aiotrade.lib.math.timeseries.{TSer, SerChangeEvent}
39.35 import scala.collection.Set
39.36 -import scala.collection.mutable.{ArrayBuffer,HashMap}
39.37 +import scala.collection.mutable.{HashMap}
39.38
39.39 /**
39.40 * This class will load the quote datas from data source to its data storage: quotes.
39.41 @@ -76,7 +72,7 @@
39.42
39.43 val ANCIENT_TIME: Long = -1
39.44 // --- Following maps should be created once here, since server may be singleton:
39.45 - private val contractToStorage = new HashMap[C, ArrayBuffer[V]]
39.46 + private val contractToStorage = new HashMap[C, ArrayList[V]]
39.47 private val subscribedContractToSer = new HashMap[C, TSer]
39.48 /** a quick seaching map */
39.49 private val subscribedSymbolToContract = new HashMap[String, C]
39.50 @@ -87,7 +83,7 @@
39.51 * second one (if available) is that who concerns first one.
39.52 * Example: ticker ser also will compose today's quoteSer
39.53 */
39.54 - private val serToChainSers = new HashMap[TSer, ArrayBuffer[TSer]]
39.55 + private val serToChainSers = new HashMap[TSer, ArrayList[TSer]]
39.56 private var loadServer: LoadServer = _
39.57 private var updateServer: UpdateServer = _
39.58 private var updateTimer: Timer = _
39.59 @@ -133,10 +129,10 @@
39.60 */
39.61 }
39.62
39.63 - protected def storageOf(contract: C): ArrayBuffer[V] = {
39.64 + protected def storageOf(contract: C): ArrayList[V] = {
39.65 contractToStorage.get(contract) match {
39.66 case None =>
39.67 - val storage1 = new ArrayBuffer[V]
39.68 + val storage1 = new ArrayList[V]
39.69 contractToStorage.put(contract, storage1)
39.70 storage1
39.71 case Some(x) => x
39.72 @@ -161,14 +157,14 @@
39.73 }
39.74 }
39.75 contractToStorage.synchronized {
39.76 - contractToStorage.removeKey(contract)
39.77 + contractToStorage.remove(contract)
39.78 }
39.79 }
39.80
39.81 - protected def returnBorrowedTimeValues(datas: ArrayBuffer[V]): Unit
39.82 + protected def returnBorrowedTimeValues(datas: ArrayList[V]): Unit
39.83
39.84 - protected def isAscending(values: Array[V]) :boolean = {
39.85 - val size = values.size
39.86 + protected def isAscending(values: Array[V]): Boolean = {
39.87 + val size = values.length
39.88 if (size <= 1) {
39.89 true
39.90 } else {
39.91 @@ -229,10 +225,7 @@
39.92 subscribedSymbolToContract.put(contract.symbol, contract)
39.93 }
39.94 serToChainSers.synchronized {
39.95 - val chainSersX = serToChainSers.get(ser) match {
39.96 - case None => new ArrayBuffer[TSer]
39.97 - case Some(x) => x
39.98 - }
39.99 + val chainSersX = serToChainSers.get(ser) getOrElse new ArrayList[TSer]
39.100 chainSersX ++= chainSers
39.101 serToChainSers.put(ser, chainSersX)
39.102 }
39.103 @@ -241,13 +234,13 @@
39.104 def unSubscribe(contract: C): Unit = {
39.105 cancelRequest(contract)
39.106 serToChainSers.synchronized {
39.107 - serToChainSers.removeKey(subscribedContractToSer.get(contract).get)
39.108 + serToChainSers.remove(subscribedContractToSer.get(contract).get)
39.109 }
39.110 subscribedContractToSer.synchronized {
39.111 - subscribedContractToSer.removeKey(contract)
39.112 + subscribedContractToSer.remove(contract)
39.113 }
39.114 subscribedSymbolToContract.synchronized {
39.115 - subscribedSymbolToContract.removeKey(contract.symbol)
39.116 + subscribedSymbolToContract.remove(contract.symbol)
39.117 }
39.118 releaseStorage(contract)
39.119 }
39.120 @@ -336,7 +329,7 @@
39.121 * @param serToBeFilled Ser
39.122 * @param time values
39.123 */
39.124 - protected def composeSer(symbol: String, serToBeFilled: TSer, storage: ArrayBuffer[V]): SerChangeEvent
39.125 + protected def composeSer(symbol: String, serToBeFilled: TSer, storage: ArrayList[V]): SerChangeEvent
39.126
39.127 protected class LoadServer extends Runnable {
39.128 override def run: Unit = {
40.1 --- a/modules/lib.math/src/org/aiotrade/lib/math/timeseries/descriptor/AnalysisContents.scala Mon Nov 02 17:30:56 2009 +0800
40.2 +++ b/modules/lib.math/src/org/aiotrade/lib/math/timeseries/descriptor/AnalysisContents.scala Mon Nov 02 19:50:46 2009 +0800
40.3 @@ -39,7 +39,7 @@
40.4 import org.aiotrade.lib.util.swing.action.WithActionsHelper;
40.5 import org.aiotrade.lib.util.swing.action.SaveAction;
40.6 import org.w3c.dom.Element
40.7 -import scala.collection.mutable.ArrayBuffer
40.8 +import org.aiotrade.lib.util.collection.ArrayList
40.9 /**
40.10 *
40.11 * @author Caoyuan Deng
40.12 @@ -51,7 +51,7 @@
40.13 var serProvider: SerProvider[_] = _
40.14
40.15 /** use List to store descriptor, so they can be ordered by index */
40.16 - private val descriptorBuf = new ArrayBuffer[AnalysisDescriptor[_]]
40.17 + private val descriptorBuf = new ArrayList[AnalysisDescriptor[_]]
40.18
40.19 def descriptors: List[AnalysisDescriptor[_]] = descriptorBuf.toList
40.20
40.21 @@ -90,7 +90,7 @@
40.22 * try to avoid java.util.ConcurrentModificationException by add those to
40.23 * toBeRemoved, then call descriptorList.removeAll(toBeRemoved)
40.24 */
40.25 - val toBeRemoved = new ArrayBuffer[Int]
40.26 + val toBeRemoved = new ArrayList[Int]
40.27 var i = 0
40.28 for (descriptor <- descriptorBuf) {
40.29 if (tpe.isInstance(descriptor)) {
40.30 @@ -111,7 +111,7 @@
40.31 * If found none, return an empty collection other than null
40.32 */
40.33 def lookupDescriptors[T <: AnalysisDescriptor[Any]](tpe: Class[T]): Seq[T] = {
40.34 - val result = new ArrayBuffer[T]
40.35 + val result = new ArrayList[T]
40.36 for (descriptor <- descriptorBuf) {
40.37 if (tpe.isInstance(descriptor)) {
40.38 result += descriptor.asInstanceOf[T]
40.39 @@ -125,7 +125,7 @@
40.40 * Lookup the descriptorList of clazz (Indicator/Drawing/Source etc) with the same time frequency
40.41 */
40.42 def lookupDescriptors[T <: AnalysisDescriptor[Any]](tpe: Class[T], freq: TFreq): Seq[T] = {
40.43 - val result = new ArrayBuffer[T]
40.44 + val result = new ArrayList[T]
40.45 for (descriptor <- descriptorBuf) {
40.46 if (tpe.isInstance(descriptor) && descriptor.freq.equals(freq)) {
40.47 result += descriptor.asInstanceOf[T]
41.1 --- a/modules/lib.math/src/org/aiotrade/lib/math/vector/SparseVec.scala Mon Nov 02 17:30:56 2009 +0800
41.2 +++ b/modules/lib.math/src/org/aiotrade/lib/math/vector/SparseVec.scala Mon Nov 02 19:50:46 2009 +0800
41.3 @@ -32,7 +32,7 @@
41.4
41.5 import java.util.Random
41.6 import java.util.StringTokenizer
41.7 -import scala.collection.mutable.ArrayBuffer
41.8 +import org.aiotrade.lib.util.collection.ArrayList
41.9
41.10 /**
41.11 * Sparse implement of Vec. It do not store 0 valued elements.
41.12 @@ -245,7 +245,7 @@
41.13 newItems
41.14 case _ =>
41.15
41.16 - val itemBuf = new ArrayBuffer[VecItem]
41.17 + val itemBuf = new ArrayList[VecItem]
41.18 for (i <- 0 until src.dimension) {
41.19 val value = src.apply(i)
41.20 if (value != 0) {
42.1 --- a/modules/lib.securities/src/org/aiotrade/lib/securities/PersistenceManager.scala Mon Nov 02 17:30:56 2009 +0800
42.2 +++ b/modules/lib.securities/src/org/aiotrade/lib/securities/PersistenceManager.scala Mon Nov 02 19:50:46 2009 +0800
42.3 @@ -32,7 +32,7 @@
42.4
42.5 import org.aiotrade.lib.math.timeseries.TFreq
42.6 import org.aiotrade.lib.util.ServiceLoader
42.7 -import scala.collection.mutable.ArrayBuffer
42.8 +import org.aiotrade.lib.util.collection.ArrayList
42.9
42.10 /**
42.11 *
42.12 @@ -51,8 +51,8 @@
42.13
42.14 trait PersistenceManager extends org.aiotrade.lib.math.PersistenceManager {
42.15
42.16 - def saveQuotes(symbol: String, freq: TFreq, quotes: ArrayBuffer[Quote], sourceId: Long): Unit
42.17 - def restoreQuotes(symbol: String, freq: TFreq): ArrayBuffer[Quote]
42.18 + def saveQuotes(symbol: String, freq: TFreq, quotes: ArrayList[Quote], sourceId: Long): Unit
42.19 + def restoreQuotes(symbol: String, freq: TFreq): ArrayList[Quote]
42.20 def deleteQuotes(symbol: String, freq: TFreq, fromTime: Long, toTime: Long): Unit
42.21 def dropAllQuoteTables(symbol: String): Unit
42.22
43.1 --- a/modules/lib.securities/src/org/aiotrade/lib/securities/dataserver/QuoteServer.scala Mon Nov 02 17:30:56 2009 +0800
43.2 +++ b/modules/lib.securities/src/org/aiotrade/lib/securities/dataserver/QuoteServer.scala Mon Nov 02 19:50:46 2009 +0800
43.3 @@ -37,7 +37,7 @@
43.4 import org.aiotrade.lib.math.timeseries.{TSer,AddAll}
43.5 import org.aiotrade.lib.securities.{Market, Quote, QuotePool, PersistenceManager}
43.6
43.7 -import scala.collection.mutable.ArrayBuffer
43.8 +import org.aiotrade.lib.util.collection.ArrayList
43.9
43.10 /**
43.11 * This class will load the quote datas from data source to its data storage: quotes.
43.12 @@ -60,7 +60,7 @@
43.13 quotePool.returnObject(quote)
43.14 }
43.15
43.16 - protected def returnBorrowedTimeValues(quotes: ArrayBuffer[Quote]): Unit = {
43.17 + protected def returnBorrowedTimeValues(quotes: ArrayList[Quote]): Unit = {
43.18 quotes.foreach{quotePool.returnObject(_)}
43.19 }
43.20
43.21 @@ -151,7 +151,7 @@
43.22 }
43.23 }
43.24
43.25 - protected def composeSer(symbol: String, quoteSer: TSer, storage: ArrayBuffer[Quote]): SerChangeEvent = {
43.26 + protected def composeSer(symbol: String, quoteSer: TSer, storage: ArrayList[Quote]): SerChangeEvent = {
43.27 var evt: SerChangeEvent = null
43.28
43.29 val size = storage.size
44.1 --- a/modules/lib.securities/src/org/aiotrade/lib/securities/dataserver/TickerServer.scala Mon Nov 02 17:30:56 2009 +0800
44.2 +++ b/modules/lib.securities/src/org/aiotrade/lib/securities/dataserver/TickerServer.scala Mon Nov 02 19:50:46 2009 +0800
44.3 @@ -30,12 +30,13 @@
44.4 */
44.5 package org.aiotrade.lib.securities.dataserver
44.6
44.7 -import java.util.{Calendar, TimeZone}
44.8 +import java.util.{Calendar}
44.9 import org.aiotrade.lib.math.timeseries.{TFreq, TSer, SerChangeEvent, TUnit}
44.10 import org.aiotrade.lib.math.timeseries.datasource.AbstractDataServer
44.11 import org.aiotrade.lib.securities.{Market, QuoteItem, QuoteSer, Ticker, TickerObserver, TickerPool, TickerSnapshot}
44.12 import org.aiotrade.lib.util.Observable
44.13 -import scala.collection.mutable.{ArrayBuffer, HashMap}
44.14 +import org.aiotrade.lib.util.collection.ArrayList
44.15 +import scala.collection.mutable.{HashMap}
44.16
44.17 /** This class will load the quote datas from data source to its data storage: quotes.
44.18 * @TODO it will be implemented as a Data Server ?
44.19 @@ -67,7 +68,7 @@
44.20 tickerPool.returnObject(ticker)
44.21 }
44.22
44.23 - override protected def returnBorrowedTimeValues(tickers: ArrayBuffer[Ticker]): Unit = {
44.24 + override protected def returnBorrowedTimeValues(tickers: ArrayList[Ticker]): Unit = {
44.25 tickers foreach (tickerPool.returnObject(_))
44.26 }
44.27
44.28 @@ -110,7 +111,7 @@
44.29 }
44.30 }
44.31
44.32 - private val bufLoadEvents = new ArrayBuffer[SerChangeEvent]
44.33 + private val bufLoadEvents = new ArrayList[SerChangeEvent]
44.34
44.35 override protected def postLoad: Unit = {
44.36 bufLoadEvents.clear
44.37 @@ -177,7 +178,7 @@
44.38 storageOf(lookupContract(ts.symbol).get) += ticker
44.39 }
44.40
44.41 - def composeSer(symbol: String, tickerSer: TSer, storage: ArrayBuffer[Ticker]): SerChangeEvent = {
44.42 + def composeSer(symbol: String, tickerSer: TSer, storage: ArrayList[Ticker]): SerChangeEvent = {
44.43 var evt: SerChangeEvent = null
44.44
44.45 val cal = Calendar.getInstance(marketOf(symbol).timeZone)
45.1 --- a/modules/lib.util/src/org/aiotrade/lib/util/ChangeObservableHelper.scala Mon Nov 02 17:30:56 2009 +0800
45.2 +++ b/modules/lib.util/src/org/aiotrade/lib/util/ChangeObservableHelper.scala Mon Nov 02 19:50:46 2009 +0800
45.3 @@ -43,7 +43,7 @@
45.4 * @version 1.0, November 24, 2006, 5:09 PM
45.5 * @since 1.0.4
45.6 */
45.7 -import scala.collection.mutable.ArrayBuffer
45.8 +import org.aiotrade.lib.util.collection.ArrayList
45.9 import scala.collection.mutable.HashMap
45.10
45.11 class ChangeObservableHelper {
45.12 @@ -72,7 +72,7 @@
45.13 }
45.14
45.15 def removeObserversOf(owner: Object): Unit = {
45.16 - val toBeRemoved = new ArrayBuffer[ChangeObserver[_]]
45.17 + val toBeRemoved = new ArrayList[ChangeObserver[_]]
45.18 for (observer <- observerToOwner.keysIterator if observerToOwner.get(observer) == owner) {
45.19 toBeRemoved += observer
45.20 }
45.21 @@ -88,8 +88,8 @@
45.22 }
45.23 }
45.24
45.25 - def getObservers[T <: ChangeObserver[_]](observerType: Class[T]): ArrayBuffer[T] = {
45.26 - val result = new ArrayBuffer[T]
45.27 + def getObservers[T <: ChangeObserver[_]](observerType: Class[T]): ArrayList[T] = {
45.28 + val result = new ArrayList[T]
45.29 for (observer <- observerToOwner.keysIterator) {
45.30 result += (observer.asInstanceOf[T])
45.31 }
46.1 --- a/modules/lib.util/src/org/aiotrade/lib/util/Observable.scala Mon Nov 02 17:30:56 2009 +0800
46.2 +++ b/modules/lib.util/src/org/aiotrade/lib/util/Observable.scala Mon Nov 02 19:50:46 2009 +0800
46.3 @@ -35,12 +35,12 @@
46.4 * @author Caoyuan Deng
46.5 */
46.6 import java.lang.ref.WeakReference
46.7 -import scala.collection.mutable.ArrayBuffer
46.8 +import org.aiotrade.lib.util.collection.ArrayList
46.9
46.10 trait Observable {
46.11
46.12 private var changed: Boolean = _
46.13 - private val observerRefs = new ArrayBuffer[WeakReference[Observer[_]]]
46.14 + private val observerRefs = new ArrayList[WeakReference[Observer[_]]]
46.15
46.16 def addObserver(observer: Observer[_]): Unit = synchronized {
46.17 assert(observer != null, "Can't add a null observer!")
47.1 --- a/modules/lib.util/src/org/aiotrade/lib/util/swing/action/WithActionsHelper.scala Mon Nov 02 17:30:56 2009 +0800
47.2 +++ b/modules/lib.util/src/org/aiotrade/lib/util/swing/action/WithActionsHelper.scala Mon Nov 02 19:50:46 2009 +0800
47.3 @@ -32,7 +32,7 @@
47.4
47.5 import javax.swing.Action
47.6
47.7 -import scala.collection.mutable.ArrayBuffer
47.8 +import org.aiotrade.lib.util.collection.ArrayList
47.9
47.10 /**
47.11 *
47.12 @@ -45,10 +45,10 @@
47.13
47.14 def addAction(action: Action): Action = {
47.15 if (actions == Nil) {
47.16 - actions = new ArrayBuffer[Action]
47.17 + actions = new ArrayList[Action]
47.18 }
47.19
47.20 - actions.asInstanceOf[ArrayBuffer[Action]] += action
47.21 + actions.asInstanceOf[ArrayList[Action]] += action
47.22 action
47.23 }
47.24
48.1 --- a/modules/test/src/org/aiotrade/platform/test/PlainPersistenceManager.scala Mon Nov 02 17:30:56 2009 +0800
48.2 +++ b/modules/test/src/org/aiotrade/platform/test/PlainPersistenceManager.scala Mon Nov 02 19:50:46 2009 +0800
48.3 @@ -16,7 +16,7 @@
48.4 import org.aiotrade.lib.math.timeseries.computable.Indicator
48.5 import org.aiotrade.lib.math.timeseries.descriptor.AnalysisContents
48.6 import org.aiotrade.platform.modules.indicator.basic._
48.7 -import scala.collection.mutable.ArrayBuffer
48.8 +import org.aiotrade.lib.util.collection.ArrayList
48.9
48.10 /**
48.11 *
48.12 @@ -24,12 +24,12 @@
48.13 */
48.14 class PlainPersistenceManager extends PersistenceManager {
48.15
48.16 - private val quoteServers = new ArrayBuffer[QuoteServer]
48.17 - private val tickerServers = new ArrayBuffer[TickerServer]
48.18 - private val indicators = new ArrayBuffer[Indicator]
48.19 + private val quoteServers = new ArrayList[QuoteServer]
48.20 + private val tickerServers = new ArrayList[TickerServer]
48.21 + private val indicators = new ArrayList[Indicator]
48.22
48.23 - def saveQuotes(symbol: String, freq: TFreq, quotes: ArrayBuffer[Quote], sourceId: Long): Unit = {}
48.24 - def restoreQuotes(symbol: String, freq: TFreq): ArrayBuffer[Quote] = new ArrayBuffer[Quote]
48.25 + def saveQuotes(symbol: String, freq: TFreq, quotes: ArrayList[Quote], sourceId: Long): Unit = {}
48.26 + def restoreQuotes(symbol: String, freq: TFreq): ArrayList[Quote] = new ArrayList[Quote]
48.27 def deleteQuotes(symbol: String, freq: TFreq, fromTime: Long, toTime: Long): Unit = {}
48.28 def dropAllQuoteTables(symbol: String): Unit = {}
48.29