u 'll need to cast the node to a certain type to get type like
TermNode x = (TermNode)cur;