QueueMetrics forum

QueueMetrics => Scripting QueueMetrics => Topic started by: hello on March 03, 2009, 16:12:50

Title: java equivalent of python example
Post by: hello on March 03, 2009, 16:12:50
does anyone have a java equivalent of this python example from section 4 of the xmlrpc manaul?

for t in res.keys():
        print "===== Block " + t + ": ========"
        for r in range( len(res[t]) ):
                for c in range( len( res[t][r] )):
                        print res[t][r][c] ,
                        print "\t" ,
                print

Title: Re: java equivalent of python example
Post by: hello on March 03, 2009, 18:40:51
figured out what was going wrong, the redstone xmlrpc package returns "xmlrpcarray"s and not native java arrays!  Easy once you know that.
Title: Re: java equivalent of python example
Post by: QueueMetrics on March 04, 2009, 09:42:59
I think this depends on the java library used - anyway I see that you should be able to cast it to an ArrayList if you want to, as it is actually an extended ArrayList - see http://xmlrpc.sourceforge.net/javadoc/redstone/xmlrpc/XmlRpcArray.html