Sounds like a fairly heavy-handed solution just for that. It shouldn't afterall not be more difficult than a loop doing a bit of digging.
Did you resort to the object approach because a loop would be too expensive or because it was too difficult to figure out how it's stored?