View Javadoc

1   
2   package net.sf.classifier4J.vector;
3   
4   import java.util.HashMap;
5   import java.util.Map;
6   
7   
8   public class HashMapTermVectorStorage implements TermVectorStorage {
9       private Map storage = new HashMap();
10      
11      
12      /***
13       * @see net.sf.classifier4J.vector.TermVectorStorage#addTermVector(java.lang.String, net.sf.classifier4J.vector.TermVector)
14       */
15      public void addTermVector(String category, TermVector termVector) {
16          storage.put(category, termVector);        
17      }
18  
19      /***
20       * @see net.sf.classifier4J.vector.TermVectorStorage#getTermVector(java.lang.String)
21       */
22      public TermVector getTermVector(String category) {
23          return (TermVector) storage.get(category);
24      }
25  
26  }