code: public void addShingledSeries(String key, Map<String, Integer> shingledSeries) {
      // allocate the weights array corresponding to the time series
      int[] counts = new int[this.indexTable.size()];
      // fill in the counts
      for (String str : shingledSeries.keySet()) {
        Integer idx = this.indexTable.get(str);
        if (null == idx) {
          throw new IndexOutOfBoundsException("the requested shingle " + str + " doesn't exist!");
        }
        counts[idx] = shingledSeries.get(str);
      }
      shingles.put(key, counts);
    }
docs: Adds a shingled series assuring the proper index.
  
  @param key the timeseries key (i.e., label).
  @param shingledSeries a shingled timeseries in a map of &lt;shingle, index&gt; entries.