Esempio n. 1
0
 /** Add a single instance, with given src and id, to the datafile */
 public void addInstance(String src, String id, String text) {
   Instance inst = new Instance(src, id, text);
   ArrayList list = (ArrayList) sourceLists.get(src);
   if (list == null) {
     list = new ArrayList();
     sourceLists.put(src, list);
     sourceNames.add(src);
   }
   list.add(inst);
 }
Esempio n. 2
0
 /** Get the j-th record for the named source. */
 public Instance getInstance(String src, int j) {
   return (Instance) ((ArrayList) sourceLists.get(src)).get(j);
 }
Esempio n. 3
0
 /** Number of records for source with given string id */
 public int numInstances(String src) {
   return ((ArrayList) sourceLists.get(src)).size();
 }