Im building a generic Variable object for use in a parsed language system.
To make it versatile, the Variable object has a Data object that contains the actual variable data (no way right?).
The problem being that when I want to get the data, I am using a method, getData(), that returns an Object; meaning that I have to cast it later where I want to do things with that data.
Being somewhat new to OOP, I cant figure out a way to dynamically cast the object Data either at the class level, or the return level of getData().
I assume something like this is possible?
here is the Variable class in all its glory, with the important parts pointed out.