Author Topic: java equivalent of python example  (Read 4005 times)

hello

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
java equivalent of python example
« 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


hello

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: java equivalent of python example
« Reply #1 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.

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: java equivalent of python example
« Reply #2 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