@Override public QuerySegment add(Query query, QuerySegment segment) { mSize += query.size(); mSize += segment.size(); return mSegments.put(query, segment); }
@Override public boolean remove(Query q) { QuerySegment removedQuerySegment = null; boolean removed = false; if ((removedQuerySegment = mSegments.remove(q)) != null) { mSize -= q.size(); mSize -= removedQuerySegment.size(); removed = true; } return removed; }