Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Memory Analyzer » Accessing an element in an Array and ArrayList(want to access an element in an array)
Accessing an element in an Array and ArrayList [message #682254] Fri, 10 June 2011 17:50 Go to next message
Amod Pandey is currently offline Amod PandeyFriend
Messages: 1
Registered: June 2011
Junior Member
I have over 100k Object[] records.

Say the Object[] is like this. {"Name", "Value"}

I want to figure out the instances of Object[] with a particular value

Something like Select * from Object[] where Object[1] = "Value"

Please suggest a way to achieve it using the Analyzer or OQL.

Thank You
Re: Accessing an element in an Array and ArrayList [message #684232 is a reply to message #682254] Wed, 15 June 2011 09:13 Go to previous message
Andrew Johnson is currently offline Andrew JohnsonFriend
Messages: 164
Registered: July 2009
Senior Member
This is a bit complicated, but something like:
SELECT * FROM java.lang.Object[] s WHERE ((s.@length >= 2) and (s.@referenceArray.get(1) != 0) and (toString(${snapshot}.getObject(${snapshot}.mapAddressToId(s.@referenceArray.get(1)))) = "Value"))

should work.

This finds all the Object arrays then selects those where the length is at least 2, and with element at index 1 not null, and where the element at index 1 as an object address is converted to an MAT object ID, then to an MAT IObject, then converted to a string using an MAT name resolver, then tested against "Value".

Bug 287268 can be used to track ideas for improvements.
Previous Topic:Couldn't view memory analyzer perspective in Helios..
Next Topic:Setting up workspace directory?
Goto Forum:

Current Time: Mon Sep 28 23:22:26 GMT 2020

Powered by FUDForum. Page generated in 0.01489 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top