[tcljava-user] two things: array problem and how to handle var length arg list
Brought to you by:
mdejong
|
From: Russell R. <rus...@gm...> - 2012-02-12 18:57:23
|
Two things:
1) Problem w/ arrays...
This works ok:
% set arrayObj [java::new {int[]} 5 {11 12 99 14 15}]
java0x4
# this cast works ok too thus demonstrating that my class name is valid
% set clientTransport [java::cast *
org.cometd.client.transport.ClientTransport* $transport]
java0x3
But when I try to use that classname to create an array of these in the
same manner as int objects...
% set clientTransports [java::new {*
org.cometd.client.transport.ClientTransport*[]} 1 $clientTransport]
unknown class "org.cometd.client.transport.ClientTransport"
%
I didn't expect that result and I don't know how to correct.
2) Thing 2. A certain class constructor takes a *variable length *argument
list. Here's the signature:
*BayeuxClient<http://docs.cometd.org/apidocs/org/cometd/client/BayeuxClient.html#BayeuxClient%28java.lang.String,%20org.cometd.client.transport.ClientTransport,%20org.cometd.client.transport.ClientTransport...%29>
*(String<http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true>
url, ClientTransport<http://docs.cometd.org/apidocs/org/cometd/client/transport/ClientTransport.html>
transport, ClientTransport<http://docs.cometd.org/apidocs/org/cometd/client/transport/ClientTransport.html>
... transports)
Creates a
BayeuxClient<http://docs.cometd.org/apidocs/org/cometd/client/BayeuxClient.html>
that
will connect to the Bayeux server at the given URL and with the given
transport(s).
% set client [java::new org.cometd.client.BayeuxClient http:://
172.30.12.75:8080/cometd $clientTransport]
can't find accessible constructor with 2 argument(s) for class
"org.cometd.client.BayeuxClient"
Again, I didn't expect that result and don't know how to rephrase it in
tclblend parlance to satisfy the complaint.
Thanks in advance for any guidance you may be able to provide.
- Russ Roy
|