<commit_before>package ethanjones.data;

import ethanjones.data.other.DataEnd;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.*;

public class DataList<T extends Data> extends Data implements List<T> {

  private static DataEnd dataEnd = new DataEnd();
  private ArrayList<T> list;

  public DataList() {
    list = new ArrayList<T>();
  }

  @Override
  protected void write(DataOutput output) throws IOException {
    if (list.size() == 0) {
      output.writeByte(dataEnd.getId());//Code to allow blank arrays
      return;
    }
    output.writeByte(0);//Code to allow blank arrays
    output.writeByte(list.get(0).getId());
    output.writeInt(list.size());
    for (int i = 0; i < list.size(); i++) {
      list.get(i).write(output);
    }
  }

  @Override
  protected void read(DataInput input) throws IOException {
    list.clear();
    byte b = input.readByte();
    if (b != 0) return;//Code to allow blank arrays
    byte type = input.readByte();
    int size = input.readInt();
    for (int i = 0; i < size; i++) {
      Data data = DataTools.getData(type);
      data.read(input);
      list.add((T) data);
    }
  }

  @Override
  public byte getId() {
    return -2;
  }

  @Override
  public boolean equals(Object o) {
    if (o instanceof DataList) return ((DataList) o).list.equals(this.list);
    return false;
  }

  @Override
  public String toString() {
    return list.toString();
  }

  @Override
  public int hashCode() {
    return list.hashCode();
  }

  @Override
  public T get(int index) {
    return list.get(index);
  }

  @Override
  public T set(int index, T element) {
    return list.set(index, element);
  }

  @Override
  public void add(int index, T element) {
    list.add(index, element);
  }

  @Override
  public T remove(int index) {
    return list.remove(index);
  }

  @Override
  public int indexOf(Object o) {
    return list.indexOf(o);
  }

  @Override
  public int lastIndexOf(Object o) {
    return list.lastIndexOf(o);
  }

  @Override
  public ListIterator<T> listIterator() {
    return list.listIterator();
  }

  @Override
  public ListIterator<T> listIterator(int index) {
    return list.listIterator();
  }

  @Override
  public List<T> subList(int fromIndex, int toIndex) {
    return list.subList(fromIndex, toIndex);
  }

  @Override
  public int size() {
    return list.size();
  }

  @Override
  public boolean isEmpty() {
    return list.isEmpty();
  }<commit_msg>Update DataList.java<commit_after>package ethanjones.data;

import ethanjones.data.other.DataEnd;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.*;

public class DataList<T extends Data> extends Data implements List<T> {

  private static DataEnd dataEnd = new DataEnd();
  private ArrayList<T> list;

  public DataList() {
    list = new ArrayList<T>();
  }

  @Override
  protected void write(DataOutput output) throws IOException {
    if (list.size() == 0) {
      output.writeByte(dataEnd.getId());//Code to allow blank arrays
      return;
    }
    output.writeByte(0);//Code to allow blank arrays
    output.writeByte(list.get(0).getId());
    output.writeInt(list.size());
    for (int i = 0; i < list.size(); i++) {
      list.get(i).write(output);
    }
  }

  @Override
  protected void read(DataInput input) throws IOException {
    list.clear();
    byte b = input.readByte();
    if (b != 0) return;//Code to allow blank arrays
    byte type = input.readByte();
    int size = input.readInt();
    for (int i = 0; i < size; i++) {
      Data data = DataTools.getData(type);
      data.read(input);
      list.add((T) data);
    }
  }

  @Override
  public byte getId() {
    return -2;
  }

  @Override
  public boolean equals(Object o) {
    if (o instanceof DataList) return ((DataList) o).list.equals(this.list);
    return false;
  }

  @Override
  public String toString() {
    return list.toString();
  }

  @Override
  public int hashCode() {
    return list.hashCode();
  }

  @Override
  public T get(int index) {
    return list.get(index);
  }

  @Override
  public T set(int index, T element) {
    return list.set(index, element);
  }

  @Override
  public void add(int index, T element) {
    list.add(index, element);
  }

  @Override
  public T remove(int index) {
    return list.remove(index);
  }

  @Override
  public int indexOf(Object o) {
    return list.indexOf(o);
  }

  @Override
  public int lastIndexOf(Object o) {
    return list.lastIndexOf(o);
  }

  @Override
  public ListIterator<T> listIterator() {
    return list.listIterator();
  }

  @Override
  public ListIterator<T> listIterator(int index) {
    return list.listIterator(index);
  }

  @Override
  public List<T> subList(int fromIndex, int toIndex) {
    return list.subList(fromIndex, toIndex);
  }

  @Override
  public int size() {
    return list.size();
  }

  @Override
  public boolean isEmpty() {
    return list.isEmpty();
  }
{'fraction_non_alphanumeric': 0.12911646586345382, 'fraction_numerical': 0.002811244979919679, 'mean_word_length': 3.020177562550444, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 17, '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': '3083709', 'n_tokens_mistral': 1643, 'n_tokens_neox': 1607, 'n_words': 437}