Re: Re: Re: Re: extending arrays

Rémi Forax <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
  Le 14/12/2010 12:44, Nikolas Nehmer a écrit :
> ;-) Thanks for your hint to ClassValue. But for me it seems as if it is
> one value assigned to each class object (I might be wrong). I'm
> searching for an object based mechanism (i.e. adding a member to each
> class or a value to each array/object). I was already thinking about
> wrapping each array into a new object that holds the data I need. The
> problem I see with this solution is that I would have to replace all
> references to the array with the new object - including a full dataflow
> analysis. Due to polymorphism etc. the data flow analysis might not lead
> to unambiguous results. It would be so simple if I had access to the vm
> internal array representation.
>
> Nikolas

You can use an IdentityHashmap to associate an object to another object,
by example for a specific instance of an array you can store another 
array containing
the additional field values and use a ClassValue to store the way to read
the array containing addidional field by example field x is stored at 
location 0
of the additional array.

Rémi

> Am Di 14.12.2010 10:34 schrieb Rémi Forax<[email protected]>:
>
>> On 12/13/2010 09:48 PM, Nikolas Nehmer wrote:
>>> Performance is quite essential for my mechanism. "Simulating" sounds
>>> like adding lots of overhead.
>>>
>>> Nikolas
>>>
>> All is simulation :)
>>
>> Take a look to
>> http://download.java.net/jdk7/docs/api/java/dyn/ClassValue.html
>>
>> Rémi
>>
>>
>>> Am Mo 13.12.2010 18:04 schrieb Rémi Forax<[email protected]>:
>>>
>>>> Le 13/12/2010 17:31, Nikolas Nehmer a écrit :
>>>>> Thanks Eugene,
>>>>>
>>>>> unfortunately this is what I should have done right from the
>>>>> beginning
>>>>> of my project. Shit happens...
>>>>>
>>>>> Best regards,
>>>>> Nikolas
>>>> You can simulate it. By example, Groovy allows to add fields to java
>>>> array.
>>>>
>>>> Rémi
>>>>
message-footer.txt (text/plain, 238 B)
-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.