I am currently trying to implement a Pokedex which just uses an array list to store Pokemon objects. this is supposed to be a command line interface with certain commands like add, remove, info, help, etc. I was just wondering the best way of finding out which command the user entered. They are also allowed to enter more than one command per line.
it is assumed the user enters the correct number of terms after each command.
for example the sample run might be:
>>>add PIKACHU ELECTRIC 1 These mouse-like creatures are among the most sought-after Pokemon.
>>>info PIKACHU
PIKACHU ELECTRIC 1 These mouse-like creatures are among the most sought-after Pokemon.
>>>add RAICHU ELECTRIC 2 remove PIKACHU
Currently i have a StringTokenizer that goes through to see if the next word is .equal("add") and if it is i call my add() method which i already implemented. I'm not sure how to check for multiple commands per line either.