<commit_before>/*
 *  Copyright (c) 2012 Malhar, Inc.
 *  All Rights Reserved.
 */
package com.malhartech.lib.stream;

import com.malhartech.annotation.InputPortFieldAnnotation;
import com.malhartech.annotation.OutputPortFieldAnnotation;
import com.malhartech.api.BaseOperator;
import com.malhartech.api.DefaultInputPort;
import com.malhartech.api.DefaultOutputPort;
import java.util.ArrayList;

/**
 * Takes in an ArrayList and emits each item in the array; mainly used for breaking up a ArrayList tuple into Objects<p>
 * <br>
 * <br>
 * <b>Port Interface</b><br>
 * <b>data</b>: expects ArrayList<K><br>
 * <b>item</b>: emits K<br>
 * <br>
 * <b>Properties</b>:
 * None
 * <br>
 * <b>Compile time checks are</b>:<br>
 * None
 * <b>Benchmarks</b>: Blast as many tuples as possible in inline mode<br>
 * Operator is able to emit >150 million tuples/sec<br>
 * <br>
 *
 * @author amol
 */
public class ArrayListToItem<K> extends BaseOperator
{
  @InputPortFieldAnnotation(name = "data")
  public final transient DefaultInputPort<ArrayList<K>> data = new DefaultInputPort<ArrayList<K>>(this)
  {
    @Override
    public void process(ArrayList<K> tuple)
    {
      for (K k: tuple) {
        item.emit(k);
      }
    }
  };
  @OutputPortFieldAnnotation(name = "item")
  public final transient DefaultOutputPort<K> item = new DefaultOutputPort<K>(this);
}
<commit_msg>Added javadocs, and created a base class for UniqueCounter operators<commit_after>/*
 *  Copyright (c) 2012 Malhar, Inc.
 *  All Rights Reserved.
 */
package com.malhartech.lib.stream;

import com.malhartech.annotation.InputPortFieldAnnotation;
import com.malhartech.annotation.OutputPortFieldAnnotation;
import com.malhartech.api.BaseOperator;
import com.malhartech.api.DefaultInputPort;
import com.malhartech.api.DefaultOutputPort;
import java.util.ArrayList;

/**
 * Takes in an ArrayList and emits each item in the array; mainly used for breaking up a ArrayList tuple into Objects<p>
 * <br>
 * <br>
 * <b>Port Interface</b><br>
 * <b>data</b>: expects ArrayList<K><br>
 * <b>item</b>: emits K<br>
 * <br>
 * <b>Properties</b>:
 * None
 * <br>
 * <b>Compile time checks are</b>:<br>
 * None
 * <b>Benchmarks</b>: Blast as many tuples as possible in inline mode<br>
 * Operator is able to emit >150 million tuples/sec<br>
 * <br>
 *
 * @author amol
 */
public class ArrayListToItem<K> extends BaseOperator
{
  @InputPortFieldAnnotation(name = "data")
  public final transient DefaultInputPort<ArrayList<K>> data = new DefaultInputPort<ArrayList<K>>(this)
  {
    /**
     * Emitting one item at a time
     */
    @Override
    public void process(ArrayList<K> tuple)
    {
      for (K k: tuple) {
        item.emit(k);
      }
    }
  };
  @OutputPortFieldAnnotation(name = "item")
  public final transient DefaultOutputPort<K> item = new DefaultOutputPort<K>(this);
}

{'fraction_non_alphanumeric': 0.13054187192118227, 'fraction_numerical': 0.0049261083743842365, 'mean_word_length': 4.159709618874773, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 71, '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': '5528085', 'n_tokens_mistral': 949, 'n_tokens_neox': 921, 'n_words': 249}