corrected some javadoc and simplified java calls
revert foreach into for
Merge pull request #24 from mars3142/master

corrected some javadoc and simplified java calls