Hi,
I am having trouble with the whole treemapping thing. I have a class called TokenCount which implements a class called Analyzer.
in the class there is a method called create a TreeMap to hold tokens
first it will check to see if the map contains the Key
if it does thsn it will add one to the Counter class
but if it doesn't
then it will add the token to the map.
I am unsure of how to add one to the counter and i am unsure of how to put it in the map.
this is what i have:
public class TokenCount implements Analyzer
{
private Counter counter;
private PropertiesManager propManager;
private Map tokenMap;
/**
need a map that sorts
* Basic constructor for TokenCount object. We set input to the
* PropManager which is an instance of the PropertiesManager.
*/
public TokenCount(PropertiesManager input)
{
tokenMap = new TreeMap;
propManager = input;
}
public void processToken(
String token)
{
if((this.equals(token)))
{
// add one to counter
}
else
{
tokenMap.put();
}
any suggestions or hints pointers of where to look
I have a couple of books i have nbought on
java and none of them had anything on maps/hashmaps/treemaps/
thanks
valarie