Exemplo n.º 1
0
  /*
   * (non-Javadoc)
   * @see com.lexst.db.view.View#add(com.lexst.util.host.SiteHost, com.lexst.db.sign.range.SignRange)
   */
  @Override
  public boolean add(SiteHost host, IndexRange index) {
    if (index.getClass() != ShortIndexRange.class) {
      throw new ClassCastException("not small index");
    }
    ShortIndexRange idx = (ShortIndexRange) index;
    short begin = idx.getBegin();
    short end = idx.getEnd();
    ShortRange range = new ShortRange(begin, end);
    long chunkId = idx.getChunkId();

    IdentitySet set = mapSet.get(range);
    if (set == null) {
      set = new IdentitySet();
      mapSet.put(range, set);
    }
    return set.add(host, chunkId);
  }