Resets the buffer counter to the specified number.

@param count
number of available items in the buffer
333364
void reset(int count) {
      if (counter != null)
         counter.releaseShared(count);
      available.releaseShared(count);
   }
1166803
public function setCount(int $count, string $type = self::INFO): void
	{
		if ($count > 0) {
			switch ($type) {
				default:
					throw new InvalidArgumentException("Wrong argument 'type'");
				case self::INFO:
				case self::WARNING:
					break;
			}
			$this->count = $count;
			$this->type = $type;
		}
	}
1359242
protected void clear(int count, int margin) {

        if (margin < 64) {
            margin = 64;
        }

        int maxlookup  = hashIndex.newNodePointer;
        int accessBase = getAccessCountCeiling(count, margin);

        for (int lookup = 0; lookup < maxlookup; lookup++) {
            Object o = objectKeyTable[lookup];

            if (o != null && accessTable[lookup] < accessBase) {
                removeObject(o, false);
            }
        }

        accessMin = accessBase;
    }
36288
public void setBitCount(int count) {
        bitCount = count;
        discretes = new BitVector(count);
        //set correct length, without counting unitid and fc
        setDataLength(discretes.byteSize() + 1);
    }
655306
def decrement_display_ref_count(self, amount: int=1):
        """"""
        assert not self._closed
        self.__display_ref_count -= amount
        if self.__display_ref_count == 0:
            self.__is_master = False
        if self.__data_item:
            for _ in range(amount):
                self.__data_item.decrement_data_ref_count()
1365851
public static void setPreferredLaneCount(int count) {
		final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkConstants.class);
		if (prefs != null) {
			if (count < 0) {
				prefs.remove("LANE_COUNT"); //$NON-NLS-1$
			} else {
				prefs.putInt("LANE_COUNT", count); //$NON-NLS-1$
			}
		}
	}
228096
public void loop(int count) throws ExecutionException, InterruptedException {
        if (count == -1) {
            while (true) {
                print(context.nextPacket());
            }
        } else {
            for (int i = 0; i < count; i++) {
                print(context.nextPacket());
            }
            executorService.shutdownNow();
        }
    }
1302371
public void delete(int count) throws BufferSizeException {
        if ((count < 0) || (count > capacity())) {
            throw new IllegalArgumentException("Can only delete between 0 and " + capacity() + " bytes from buffer, you passed in=" + count);
        }
        if (count > size()) {
            throw new BufferSizeException("Buffer size (" + size() + ") not large enough to delete (" + count + ") bytes");
        }
        this.currentReadPosition = (this.currentReadPosition + count) % this.buffer.length;
        this.currentBufferSize -= count;
    }
80643
public Stream<T> take(final int count) {
        return new Stream<T>() {
            @Override
            public Iterator<T> iterator() {
                return new ReadOnlyIterator<T>() {

                    Iterator<T> iterator = Stream.this.iterator();
                    int left = count;

                    @Override
                    public boolean hasNext() {
                        return left > 0 && iterator.hasNext();
                    }

                    @Override
                    public T next() {
                        left--;
                        return iterator.next();
                    }
                };
            }
        };
    }
1204807
public void skip (int count) throws KryoException {
		int skipCount = Math.min(limit - position, count);
		while (true) {
			position += skipCount;
			count -= skipCount;
			if (count == 0) break;
			skipCount = Math.min(count, capacity);
			require(skipCount);
		}
	}
337178
@Override
    public void rewind(int count) throws IOException
    {
        if (count < 0)
        {
            throw new IllegalArgumentException("negative rewind "+count);
        }
        cursor -= count;
        if (cursor < end - size || cursor < 0)
        {
            throw new IOException("insufficient room in the pushback buffer");
        }
        length -= count;
        if (length < 0)
        {
            throw new IOException("rewinding past input");
        }
        int ld = 0;
        for (int ii=0;ii<count;ii++)
        {
            if (get((cursor+ii)) == '\n')
            {
                ld++;
            }
        }
        if (ld > 0)
        {
            int l = includeLevel.line;
            includeLevel.line = l - ld;
            int c = 0;
            long start = Math.max(0, end-size);
            for (long ii=cursor;ii>=start;ii--)
            {
                if (get(ii) == '\n')
                {
                    break;
                }
                c++;
            }
            includeLevel.column = c;
        }
        else
        {
            int c = includeLevel.column;
            includeLevel.column = c - count;
        }
    }
122163
public int setCount (K key, int count)
    {
        int[] val = get(key);
        if (val == null) {
            put(key, new int[] { count });
            return 0; // old value
        }
        int oldVal = val[0];
        val[0] = count;
        return oldVal;
    }
33771
function(count) {
      count = count || this.INIT_COUNT;
      jsl.status(this.name + ' x ' + count);
      this.running = true;
      var me = this;
      setTimeout(function() {me._run(count);}, 200);
    }
146058
function bufferCount(bufferSize, startBufferEvery) {
    if (startBufferEvery === void 0) {
        startBufferEvery = null;
    }
    return function bufferCountOperatorFunction(source) {
        return source.lift(new BufferCountOperator(bufferSize, startBufferEvery));
    };
}
300143
public static Matcher<PrintableResult> failureCountIs(final int count) {
        return new TypeSafeMatcher<PrintableResult>() {
            public void describeTo(Description description) {
                description.appendText("has " + count + " failures");
            }

            @Override
            public boolean matchesSafely(PrintableResult item) {
                return item.failureCount() == count;
            }
        };
    }
205292
@GuardedBy("maxNumberInvariant")
   private void resetNumberOfKeys() {
      maxNumberOfKeys.set(address2key.keySet().size() * bufferSize);
      existingKeyCount.set(0);
      if (trace) {
         log.tracef("resetNumberOfKeys ends with: maxNumberOfKeys=%s, existingKeyCount=%s",
                    maxNumberOfKeys.get(), existingKeyCount.get());
      }
   }
1141958
public void incrementCounter(BugChecker bugChecker, String key, int count) {
    statisticsCollector.incrementCounter(statsKey(bugChecker.canonicalName() + "-" + key), count);
  }