Skip to main content

How to get Integer[] from java class

1 reply [Last post]
skinder
Offline
Joined: 2008-05-23

I have:
java class:
...
public Integer[] getVertexNeighbours(int vertexId)
{
Integer[] VertexNeighbours = new Integer[adjacencyLists[vertexId].size()];
adjacencyLists[vertexId].toArray(VertexNeighbours);
return VertexNeighbours;
}
...
fx class:
...
var g = new Graph();
g.UpdateData();
var vn: Integer[];
vn = g.getVertexNeighbours(i);
...
Error:

setAsSequence(com.sun.javafx.runtime.sequence.Sequence<? extends java.lang.Integer>) in com.sun.javafx.runtime.location.SequenceVariable cannot be applied to (java.lang.Integer[])

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexsch
Offline
Joined: 2007-07-12

It is an issue in compiler.
There is a workaround for it:

[code]
var vn = g.getVertexNeighbours(i);
[/code]
And the Java array should not have nul values.