<commit_before>package de.lmu.ifi.dbs.elki.visualization.visualizers;

import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.Iterator;

import de.lmu.ifi.dbs.elki.utilities.datastructures.AbstractFilteredIterator;
import de.lmu.ifi.dbs.elki.utilities.datastructures.IterableIterator;

/**
 * A list to handle visualizations.
 * 
 * @author <NAME>
 */
public class VisualizerList extends AbstractCollection<Visualizer> {
  /**
   * The actual data storage.
   */
  protected ArrayList<Visualizer> visualizers = new ArrayList<Visualizer>();
  
  /**
   * Constructor.
   */
  public VisualizerList() {
    super();
  }

  @Override
  public boolean add(Visualizer e) {
    return visualizers.add(e);
  }
    
  @Override
  public boolean contains(Object o) {
    return visualizers.contains(o);
  }

  @Override
  public boolean remove(Object o) {
    return visualizers.remove(o);
  }

  @Override
  public Iterator<Visualizer> iterator() {
    return visualizers.iterator();
  }

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

  /**
   * Iterate over all tools.
   * 
   * @return Iterator and Iterable
   */
  public IterableIterator<Visualizer> getVisible() {
    return new VisibleVisualizers();
  }

  /**
   * Iterate over all tools.
   * 
   * @return Iterator and Iterable
   */
  public IterableIterator<Visualizer> getTools() {
    return new VisibleVisualizers();
  }

  /**
   * Class to filter for visible visualizers only.
   * 
   * @author <NAME>
   */
  class VisibleVisualizers extends AbstractFilteredIterator<Visualizer> implements IterableIterator<Visualizer> {
    @Override
    protected Iterator<Visualizer> getParentIterator() {
      return visualizers.iterator();
    }

    @Override
    protected boolean testFilter(Visualizer nextobj) {
      return VisualizerUtil.isVisible(nextobj);
    }

    @Override
    public Iterator<Visualizer> iterator() {<commit_msg>Bug fix. Thanks, Simon.<commit_after>package de.lmu.ifi.dbs.elki.visualization.visualizers;

import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.Iterator;

import de.lmu.ifi.dbs.elki.utilities.datastructures.AbstractFilteredIterator;
import de.lmu.ifi.dbs.elki.utilities.datastructures.IterableIterator;

/**
 * A list to handle visualizations.
 * 
 * @author <NAME>
 */
public class VisualizerList extends AbstractCollection<Visualizer> {
  /**
   * The actual data storage.
   */
  protected ArrayList<Visualizer> visualizers = new ArrayList<Visualizer>();
  
  /**
   * Constructor.
   */
  public VisualizerList() {
    super();
  }

  @Override
  public boolean add(Visualizer e) {
    return visualizers.add(e);
  }
    
  @Override
  public boolean contains(Object o) {
    return visualizers.contains(o);
  }

  @Override
  public boolean remove(Object o) {
    return visualizers.remove(o);
  }

  @Override
  public Iterator<Visualizer> iterator() {
    return visualizers.iterator();
  }

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

  /**
   * Iterate over all tools.
   * 
   * @return Iterator and Iterable
   */
  public IterableIterator<Visualizer> getVisible() {
    return new VisibleVisualizers();
  }

  /**
   * Iterate over all tools.
   * 
   * @return Iterator and Iterable
   */
  public IterableIterator<Visualizer> getTools() {
    return new ToolVisualizers();
  }

  /**
   * Class to filter for visible visualizers only.
   * 
   * @author <NAME>
   */
  class VisibleVisualizers extends AbstractFilteredIterator<Visualizer> implements IterableIterator<Visualizer> {
    @Override
    protected Iterator<Visualizer> getParentIterator() {
      return visualizers.iterator();
    }

    @Override
    protected boolean testFilter(Visualizer nextobj) {
      return VisualizerUtil.isVisible(nextobj);
    }

    @Override
    public Iterator<Visualizer> iterator() {
{'fraction_non_alphanumeric': 0.10717039321511179, 'fraction_numerical': 0.0, 'mean_word_length': 3.4126984126984126, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '1695088', 'n_tokens_mistral': 1196, 'n_tokens_neox': 1160, 'n_words': 263}