This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Unable to retrieve a sequence from a Java Collection
Mathew Kuruvilla
Ranch Hand
Joined: Nov 27, 2001
Posts: 135
posted
0
Consider the following code:
function updateChartData() {
var test: LineChart.Data[] = [];
for (x in [0..10 step 1]) {
insert LineChart.Data { xValue: x yValue: Math.sin(x)*100 - x } into test
}
var a: HashMap = new HashMap();
a.put(0, test);
delete test;
var retest: LineChart.Data[] = a.get(0) as LineChart.Data[];
println("size of retest is: {sizeof retest}");
println(retest);
}
I get the following exception:
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: com.sun.javafx.runtime.sequence.ObjectArraySequence cannot be cast to javafx.scene.chart.LineChart$Data
at com.sasken.vas.application.Main.updateChartdata(Main.fx:263)
Any suggestions will be appreciated
Philippe Lhoste
Greenhorn
Joined: Oct 23, 2009
Posts: 28
posted
0
Again, I will point to another thread... :-) (I love hyperlinking/cross-references...) :-D