<commit_before>package org.jrivets.collection;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;

/**
 * Ring Buffer is a container with fixed capacity and FIFO discipline: elements
 * can be added to the end of the buffer and obtained from the head only. The
 * <tt>RingBuffer</tt> implements {@link Collection} interface to be used easily
 * in some iteration routines, but some methods for modification the collection
 * like <tt>addAll()</tt>, <tt>removeAll()</tt> etc. are not supported and will
 * throw {@link UnsupportedOperationException} exception.
 * <p>
 * <strong>Note that this implementation is not synchronized.</strong> If
 * multiple threads access a <tt>RingBuffer</tt> instance concurrently, and at
 * least one of the threads modifies the list structurally, it <i>must</i> be
 * synchronized externally <strong>except the use case as follows:</strong>
 * <p>
 * If one thread is reader (uses <tt>removeFirst()</tt> and <tt>size()</tt>
 * methods only), and another one is writer (uses <tt>add()</tt> and
 * <tt>size()</tt> methods only), the methods can be called without any
 * synchronization. For all other scenarios the buffer is not thread-safe, so<commit_msg>cosmetic changes<commit_after>package org.jrivets.collection;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;

/**
 * Ring Buffer is a container with fixed capacity and FIFO discipline: elements
 * can be added to the end of the buffer and removed from the head only. The
 * <tt>RingBuffer</tt> implements {@link Collection} interface to be used easily
 * in some iteration routines, but some methods for modification the collection
 * like <tt>addAll()</tt>, <tt>removeAll()</tt> etc. are not supported and will
 * throw {@link UnsupportedOperationException} exception.
 * <p>
 * <strong>Note that this implementation is not synchronized.</strong> If
 * multiple threads access a <tt>RingBuffer</tt> instance concurrently, and at
 * least one of the threads modifies the list structurally, it <i>must</i> be
 * synchronized externally <strong>except the use case as follows:</strong>
 * <p>
 * If one thread is reader (uses <tt>removeFirst()</tt> and <tt>size()</tt>
 * methods only), and another one is writer (uses <tt>add()</tt> and
 * <tt>size()</tt> methods only), the methods can be called without any
 * synchronization. For all other scenarios the buffer is not thread-safe, so
{'fraction_non_alphanumeric': 0.10550814584949574, 'fraction_numerical': 0.0, 'mean_word_length': 4.942396313364055, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7655052', 'n_tokens_mistral': 707, 'n_tokens_neox': 677, 'n_words': 304}