Пример #1
0
 @Override
 public Container add(int begin, int end) {
   BitmapContainer answer = clone();
   Util.setBitmapRange(answer.bitmap, begin, end);
   answer.computeCardinality();
   return answer;
 }
Пример #2
0
 @Override
 public Container remove(int begin, int end) {
   BitmapContainer answer = clone();
   Util.resetBitmapRange(answer.bitmap, begin, end);
   answer.computeCardinality();
   if (answer.getCardinality() <= ArrayContainer.DEFAULT_MAX_SIZE)
     return answer.toArrayContainer();
   return answer;
 }
Пример #3
0
 @Override
 public Container andNot(RunContainer x) {
   // could be rewritten as return andNot(x.toBitmapOrArrayContainer());
   BitmapContainer answer = this.clone();
   for (int rlepos = 0; rlepos < x.nbrruns; ++rlepos) {
     int start = Util.toIntUnsigned(x.getValue(rlepos));
     int end = start + Util.toIntUnsigned(x.getLength(rlepos)) + 1;
     Util.resetBitmapRange(answer.bitmap, start, end);
   }
   answer.computeCardinality();
   if (answer.getCardinality() > ArrayContainer.DEFAULT_MAX_SIZE) return answer;
   else return answer.toArrayContainer();
 }