<commit_before>package rocketpower.library;

import java.util.logging.Logger;


/*
 * Connection device baseclass
 */
abstract class RocketDevice {
    private TrackContainer tracks;
    protected Logger logger;

    RocketDevice(Logger logger, TrackContainer tracks) {
        this.logger = logger;
        this.tracks = tracks;
    }

    abstract public void update();
}<commit_msg>RocketDevice: listen to TrackContainer changes<commit_after>package rocketpower.library;

import java.util.logging.Logger;


/*
 * Connection device baseclass
 */
abstract class RocketDevice implements TrackContainerListener {
    private TrackContainer tracks;
    protected Logger logger;

    RocketDevice(Logger logger, TrackContainer tracks) {
        this.logger = logger;
        this.tracks = tracks;
        this.tracks.addEventListener(this);
    }

    /**
     * If device has been initialized, it must be closed.
     *
     * Removes event listener.
     */
    public void close() {
        this.tracks.removeEventListener(this);
    }

    abstract public void update();
    public void trackAdded(String name) {}
    public void trackDeleted(String name) {}
}
{'fraction_non_alphanumeric': 0.08440999138673558, 'fraction_numerical': 0.0, 'mean_word_length': 3.15, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5903985', 'n_tokens_mistral': 306, 'n_tokens_neox': 292, 'n_words': 87}