Graphing

Is there a more intelligent way to do this? All that's coming to mind at the moment is tracking which fields are strings, probably by putting an instanceof in the constructor, which isn't really different.