<commit_before>package ru.job4j.tracker;
import java.util.*;
import java.util.Arrays;

public class Tracker {
    private Item[] items = new Item[100];
    private int position = 0;
    private static final Random RN = new Random();

    public void assingValue(Item value) {
        for (int index = 0; index < this.position; index++) {
            if (this.items[index].getId().equals(value.getId())) {
                this.items[index] = value;
                break;
            }
        }
    }

    public Item add(Item item) {
        item.setId(this.generateId());
        this.items[position++] = item;
        return item;
    }

    public void update(Item item) {
        this.assingValue(item);
    }

    public void delete(Item item) {
       this.assingValue(null);
    }

    public Item[] findAll() {
        Item[] result = new Item[this.position];
        int k = 0;<commit_msg>2. Реализовать класс Tracker [ #396]<commit_after>package ru.job4j.tracker;
import java.util.*;
import java.util.Arrays;

public class Tracker {
    private Item[] items = new Item[100];
    private int position = 0;
    private static final Random RN = new Random();

    public void assingValue(Item value) {
        for (int index = 0; index < this.position; index++) {
            if (this.items[index].getId().equals(value.getId())) {
                this.items[index] = value;
                break;
            }
        }
    }

    public Item add(Item item) {
        item.setId(this.generateId());
        if (this.position<this.items.length) {
            this.items[position++] = item;
        }
        return item;
    }

    public void update(Item item) {
        this.assingValue(item);
    }

    public void delete(Item item) {
       this.assingValue(null);
    }

    public Item[] findAll() {
        Item[] result = new Item[this.position];
        int k = 0;
{'fraction_non_alphanumeric': 0.12539851222104145, 'fraction_numerical': 0.009564293304994687, 'mean_word_length': 2.0568181818181817, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, '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': '5447537', 'n_tokens_mistral': 577, 'n_tokens_neox': 551, 'n_words': 145}