I need to represent data (retreived from a db) representing tabular data (with an x
and y
axis):
The pair (x,y)
has data (an object) associated with it. What would be the most semantically correct way to represent this structure? Of course I have to retrieve the data by indexing either by x or by y, but a symmetric way to represent this would be great.
The difficulty is that x and y alone do not map to the data object, by the pair (x,y) does. I have come up with things like a map from x to another map with y as the key and the data object as the value..but this is not easily invertible and is not very symmetric.
Thanks