<commit_before>package org.robolectric.shadows;

import android.database.CursorIndexOutOfBoundsException;
import android.database.MatrixCursor;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;

import java.util.ArrayList;
import java.util.List;

@Implements(value = MatrixCursor.class, inheritImplementationMethods = true)
public class ShadowMatrixCursor extends ShadowAbstractCursor {
  private List<Object[]> data = new ArrayList<Object[]>();

  public void __constructor__(String[] columns) {
    __constructor__(columns, 0);
  }

  public void __constructor__(String[] columns, int initialCapacity) {
    columnNameArray = columns;
  }

  @Implementation
  public void addRow(Object[] data) {
    rowCount++;
    this.data.add(data);
  }

  @Implementation
  public void addRow(Iterable<?> columnValues) {
    rowCount++;

    List<Object> data = new ArrayList<Object>();
    for (Object columnValue : columnValues) {
        data.add(columnValue);
    }

    this.data.add(data.toArray());
  }

  @Implementation
  public String getString(int column) {
    Object columnValue = get(column);
    return columnValue == null ? null : columnValue.toString();
  }

  @Implementation
  public long getLong(int column) {
    Number numberValue = (Number) get(column);
    return numberValue == null ? 0 : numberValue.longValue();
  }

  @Implementation<commit_msg>Fix indentation.<commit_after>package org.robolectric.shadows;

import android.database.CursorIndexOutOfBoundsException;
import android.database.MatrixCursor;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;

import java.util.ArrayList;
import java.util.List;

@Implements(value = MatrixCursor.class, inheritImplementationMethods = true)
public class ShadowMatrixCursor extends ShadowAbstractCursor {
  private List<Object[]> data = new ArrayList<Object[]>();

  public void __constructor__(String[] columns) {
    __constructor__(columns, 0);
  }

  public void __constructor__(String[] columns, int initialCapacity) {
    columnNameArray = columns;
  }

  @Implementation
  public void addRow(Object[] data) {
    rowCount++;
    this.data.add(data);
  }

  @Implementation
  public void addRow(Iterable<?> columnValues) {
    rowCount++;

    List<Object> data = new ArrayList<Object>();
    for (Object columnValue : columnValues) {
      data.add(columnValue);
    }

    this.data.add(data.toArray());
  }

  @Implementation
  public String getString(int column) {
    Object columnValue = get(column);
    return columnValue == null ? null : columnValue.toString();
  }

  @Implementation
  public long getLong(int column) {
    Number numberValue = (Number) get(column);
    return numberValue == null ? 0 : numberValue.longValue();
  }

  @Implementation
{'fraction_non_alphanumeric': 0.10890386661936857, 'fraction_numerical': 0.001418942887548776, 'mean_word_length': 4.540275049115913, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2890809', 'n_tokens_mistral': 813, 'n_tokens_neox': 786, 'n_words': 186}