This is a counting-out rhyme of the Mother Goose persuasion. Children (generally girls, I would wager) would use it to tell their fortunes by their apple seeds, cherry stones, or what have you. The rhyme determined who the counter would marry. There appear to have been quite a number of variations, but this is the one I have always heard; since it's a traditional rhyme, and apparently an oral tradition, let's just say this is a current version.
rich man, poor man,
beggar man, thief!
for more variations: http://ingeb.org/songs/tinkerta.html